Closed Pragadesh-45 closed 1 day ago
Hi! Following this fix as it really bugs me as well. Was just checking the code fix, why exactly would you differentiate between <500 chars and >=500 chars? I would expect the >=500 chars to work in every situation and for the sake of code simplicity, it should not be handled differently without a very good reason (imho).
Hey @philippthiele,
Thank you for sharing your opinion. While working on this, I noticed that the app's performance was declining when the input exceeded 1000 characters. I realized the need to mask every item individually. I even tried improving performance by storing the positions and applying bulk masking, but it resulted in roughly the same performance.
This led me to consider a different approach: creating a maskedNode
for every line to improve performance. However, I noticed that this approach made it difficult to view and edit masked variables side by side, which is useful in many cases, such as editing environment variables.
That’s why I raised a PR with this logic—I just wanted to solve this problem. I’d love to hear your thoughts on it!
@Pragadesh-45 thanks for the explanation, it is not a use case I use, but that explains it. Waiting eagerly for this fix to be merged!
Thank you, @philippthiele, for your understanding!
Thank you @Pragadesh-45 !
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:
Before:
https://github.com/user-attachments/assets/4b920159-1a16-4a29-b984-c460e5e6bb94
After:
https://github.com/user-attachments/assets/6c63dfea-5d0f-4c79-8e0a-80216c482573
Contribution Checklist: