Repository navigation
perf(editor): keep the preview updating while scrubbing - #2535
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. |
added 4 commits
October 14, 2026 12:10
A newer preview request cancelled the in-flight frame every time, so a scrub faster than one seek never presented a frame until the mouse stopped. A newer request now only wins while a frame was presented in the last 33 ms; otherwise the in-flight frame is shown and the renderer moves on to the latest request.
notkainoa
force-pushed
the
perf/scrub-preview-frames
branch
from
October 14, 2026 19:34
137eb09 to
8e8755f
Compare
Member
|
@greptileai review |
Member
|
Verified hands-on in the real editor before merging (M4 Max, release build 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.
The preview keeps updating while you drag the playhead, instead of freezing until you let go.
Ranges cover 7 interleaved runs of before and after.
The problem
Every mouse move during a drag sends a new preview request. The renderer cancelled the frame it was decoding whenever a newer request arrived. A seek on a real recording takes longer than the gap between mouse events, so every frame got cancelled before it was shown.
What changed
On a slow forward drag both versions show a similar, noisy number of frames. The difference is timing: before, the frames come in a burst and the preview then freezes for about 6 s. After, they're spread across the drag.
Trade-off
Because the frame in progress finishes first, the final frame can arrive a little later after you stop the mouse:
Each seek here takes about 200–300 ms, which caps a fast drag at about 4 frames per second. #2492 makes seeks cheaper and would combine with this change.
Scope
main.Checks
cargo test -p cap-editor --release: 195 passed on currentmain.cargo clippy -p cap-editor --release --all-targets -- -D warningsandcargo fmtare clean.Benchmark setup (
crates/editor/examples/scrub-benchmark.rs, new)reference-recording.capfrom Cap's performance fixtures: 30.8 s, 2 segments, 3024×1964 display plus camera. Preview at 960×540 (Half quality), mouse events at 120 Hz, Apple M1, release build. Each figure is the range over 7 benchmark invocations (each the mean of 3–5 runs), with before and after interleaved so machine load hits both equally.

Confidence Score: 5/5
The PR appears safe to merge; no new blocking issue was found.Summary
The paused preview now finishes an overdue frame instead of repeatedly cancelling it during a scrub, then reads the newest queued request.
The previous-review ancestry checks did not pass, so this review covered the full PR diff. No new actionable issues were found. Tests were inspected, not run.
Reviews (2) · Last reviewed commit: "test(editor): cover when a newer scrub r..." · Reviewed by Greptile