terminal: Improve scroll performance#44714
Merged
probably-neb merged 4 commits intozed-industries:mainfrom Dec 16, 2025
Merged
Conversation
Contributor
Author
|
I thought maybe in this case I could be okay with submitting a performance PR without performance measurements, but I ... just ... can't ... lol. Putting this back into draft to add a performance test. |
Collaborator
|
We love tests! @davewa ping me when this is ready and I'll make sure we get to this during Quality Week. |
Contributor
Author
|
@franciskafyi fyi, ready for review now. |
davewa
commented
Dec 13, 2025
Collaborator
|
I'm ready to merge this when you are @davewa |
Contributor
Author
|
I’m ready! |
Collaborator
|
Great work as usual @davewa! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to:
Previously we were searching for hyperlinks on every scroll, even if Cmd was not held. With this PR,
last_hovered_wordin all cases where Cmd is not heldword_from_position->schedule_find_hyperlinkschedule_find_hyperlinkPerformance measurements
The test scrolls up and down 20,000x in a loop. However, since this PR is just removing a code path that was very dependent on the length of the line in terminal, it's not super meaningful as a comparison. The test uses a line length of "long line ".repeat(1000), and in main the performance is directly proportional to the line length, so for benchmarking it in main it only scrolls up and down 20x. I think all that is really useful to say is that currently scrolling is slow, and proportional to the line length, and with this PR it is buttery-smooth and unaffected by line length. I've included a few data points below anyway. At least the test can help catch future regressions.
Release Notes: