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

Line numbers: Improve performance #727

Conversation

alexanderpann
Copy link
Collaborator

This PR fixes #726

The left highlighter gets way too many relayout events which we can't influence, so we have to throttle the number of events. I've selected 250ms, which means that the line numbers only update 4 times per second or less. I've tried to create many new lines in the mbeddr documentation for testing and the update interval seems to be sufficient for small and large editors.

Copy link
Collaborator

@mgronover mgronover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good solution.

  • Please introduce a final variable with a name that is explaining the 250ms duration instead of using a magic number within the code.

Copy link
Collaborator

@mgronover mgronover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexanderpann alexanderpann merged commit 4acd570 into maintenance/mps20213 Dec 18, 2023
1 check passed
@alexanderpann alexanderpann deleted the bugfix/throttle_line_number_update_events_2021_3 branch December 18, 2023 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants