Repository navigation
perf(editor): skip timeline redraws for wheel and pinch events that change nothing - #3757
Open
ManthanNimodiya wants to merge 3 commits into
Open
ManthanNimodiya wants to merge 3 commits into
ManthanNimodiya wants to merge 3 commits into
Conversation
…hange nothing Adds a wheel-at-edge scenario to the timeline bench.
Contributor
|
@ManthanNimodiya is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
This comment has been minimized.
This comment has been minimized.
Seeks to 0 before zooming out so every wheel event clamps from the first frame.
Contributor
Author
|
@greptileai review |
Contributor
Author
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Author
|
@greptileai review @richiemcilroy merged main in, so this is current. Greptile was 5/5 and CI green on the previous head; |
This branch was previously deployed
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.
Summary
Trackpad momentum keeps sending wheel events (~120/s) after the timeline transform has hit its clamp, e.g. swiping left on a fully zoomed-out timeline or pinching past the zoom limits. Each of those events still logged an
info"timeline transform" line and calledcx.notify()on the whole editor, rebuilding every section for a transform that had not changed.timeline_wheelandtimeline_pinchnow compare the transform before and after and return early when it is unchanged. The deferredtimeline_scrolloffset restore still runs, and gpui's scroll container still notifies on its own when its offset moves.Measurements
New
wheel-at-edgescenario in the timeline bench (CAP_GPUI_AUTO_TIMELINE_BENCH=1): fully zoomed out, a horizontal wheel event toward the start before each timed draw. M4 MacBook Pro, 30 s studio project (display, camera, mic, system audio), release build, 3 alternating runs each:clean(no change, reference)After the change a clamped wheel event costs the same as the
cleanscenario. The bench forces a draw every iteration, so in the app the saving is larger: no frame is requested at all. The bench log also drops from 360 "timeline transform" lines to 0.Validation
cargo test --locked --bin cap-gpuipasses: 1777 passed, 0 failed.cargo fmt --checkclean for the changed files.

Confidence Score: 5/5
The PR appears safe to merge.Summary
The PR skips editor redraws and transform logs when wheel or pinch events leave the timeline unchanged.
Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile