Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve masking logic in MaskedEditor for large content handling (fixes #2842) #3472

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Pragadesh-45
Copy link
Contributor

fixes: #2842

Description

This PR is implemented to improve the app's performance when masking text in the SingleLineEditor. The logic in PR #2240 created a new node for every masked text range. While this logic performs well when the content length is less than 1000 characters, its performance degrades as the length exceeds 1000 characters. In this PR, I've addressed these performance issues.

Changes made:

  1. Added an early return if there are no lines in the editor.
  2. Limited the previous logic to cases where the number of masked characters is less than 500. This is more efficient for editing small content, such as secret environment variables.
  3. For content greater than 500 characters, implemented a line-by-line masking approach to improve performance.

Before:

20241112-1320-04.9900542.mp4

After:

20241112-1322-53.6021133.mp4

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bruno 1.24.0 is very slow when obfuscating tokens
2 participants