Repository navigation
perf(desktop-gpui): store the frame time on a paused seek so its echo does not rebuild the editor again - #2869
Open
richiemcilroy wants to merge 1 commit into
Open
richiemcilroy wants to merge 1 commit into
richiemcilroy wants to merge 1 commit into
Conversation
… does not rebuild the editor again
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Found 1 test failure on Blacksmith runners: Failure
|
richiemcilroy
marked this pull request as ready for review
October 22, 2026 06:23
Member
Author
|
@greptileai review |
This branch was successfully 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.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Why
Every pointer move while dragging the playhead with playback paused rebuilt the whole editor (header, toolbar, sidebar, transport, timeline) twice.
seek_to_timenotifies the editor once, then the engine echoes the seek back throughplayhead_changed(frame).seek_to_timehad stored the unrounded pointer time while the echo carriesframe / 60, so the echo's "already there" check never matched andinvalidate_playback_chromenotified the whole editor a second time, a frame later.What
A paused seek now stores
frame / EDITOR_PREVIEW_FPS, the exact value its echo carries, so the echo returns early. Playing seeks are unchanged (the echo there only touches the timeline and transport).playhead_changedand the seek share the sameframe_secondshelper so the two values are bit-identical.The settled playhead is the same as before: it already became
frame / 60once the echo landed. The only difference is that the line is drawn on the frame grid immediately instead of one draw later.Measured
Scratch A/B on a Blacksmith macOS 26 runner, the GPUI editor driven through the real ruler scrub handlers (
timeline_hoverthentimeline_mouse_move) every 16 ms for 10 s, 3 rounds, 40 s 1080p30 studio fixture.Frames presented per seek are unchanged (1.00 forward on both). Playback and hover counters are unchanged: no section other than the timeline and transport re-renders during playback on either side.
Tests
paused_seek_lands_where_its_echo_doeschecks, for every frame of an hour at 60 fps, that the paused seek stores exactly the timeplayhead_changedcomputes for the echo (so its early return fires), and that a playing seek keeps the pointer time.Risk
Low. Every section still rebuilds once per paused seek, so nothing that reads the playhead can go stale.


Confidence Score: 5/5
The change appears safe to merge.Summary
Paused seeks now store the requested frame’s time immediately, so the matching engine echo does not trigger another editor rebuild.
No actionable issues were found. Tests were inspected, not run.
Reviews (1) · Last reviewed commit: "perf(desktop-gpui): store the frame time..." · Reviewed by Greptile