Repository navigation
perf(desktop-gpui): repaint only the timeline and transport on hover - #2542
Merged
richiemcilroy merged 6 commits intoOct 20, 2026
Merged
Conversation
Contributor
|
Someone is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
notkainoa
marked this pull request as ready for review
October 14, 2026 16:57
notkainoa
force-pushed
the
perf/editor-section-invalidation
branch
from
October 14, 2026 19:34
43e1036 to
46fe21b
Compare
Member
|
@greptileai review |
Member
|
Verified hands-on in the real editor before merging (M4 Max, release builds of this branch merged with current
|
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.
Hovering the paused timeline no longer rebuilds the whole editor on every mouse move. With the captions tab open, each move now costs about 2.5 ms instead of 11 ms, so the ghost playhead and hover preview keep up with a 120 Hz mouse.
Captions tab open, 120 Hz mouse, slow sweep:
The problem
Every editor section (header, toolbar, transport, sidebar, timeline) observes the editor. The hover handlers called
cx.notify()on the editor, so every pointer move re-rendered the header, toolbar and sidebar too, even though only the timeline ghost playhead, the transport time and the canvas overlay read hover state.What changed
timeline_hover,timeline_hover_leaveandtrack_hovernow notify only the timeline and transport views (invalidate_hover_chrome).All results
Measured on current
main(3403665), which includes #2557. On the older base this PR was first measured on, the slow sweeps came out lower after the fix (1.4–2.9 ms). The fast sweep, which shows no preview frames, is the same on both.Known limits (out of scope)
frame_layout_requires_editor_invalidation.Scope
timeline_hoverandtimeline_hover_leavekeep their playing guards,track_hoverkeeps its drag guard, and the playhead still goes throughinvalidate_playback_chrome.set_hovered_track) still notifies the whole editor. It fires once per row, not per move.Checks
cargo test --release -p cap-desktop-gpui --bin cap-gpui editor_: 403 passed on currentmain.cargo fmtis clean.cargo clippy -- -D warningsreports no warnings in the touched files (the existing failures are in the kernels crate).Benchmark setup (
CAP_GPUI_AUTO_HOVER_BENCH=1, new,apps/desktop-gpui/src/editor_hover_bench.rs)The bench activates the window, sweeps the pointer across the paused timeline at a fixed speed, and for each move times the real hover handler plus one synchronous
Window::draw. 1 s warmup, 6 s measured. Moves that arrive while the previous one is still running are coalesced, as the OS does, and the loop yields between moves so the preview pump can run. Apple M1, release build,reference-recording.capfrom Cap's performance fixtures, 2–3 runs per row with before and after interleaved. "Before" is this branch with the three hover call sites put back tomain's full invalidation. The hook does nothing unless the env var is set.

Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
The PR narrows timeline hover redraws and adds an opt-in benchmark.
Reviews (2) · Last reviewed commit: "perf(desktop-gpui): note that hover no l..." · Reviewed by Greptile