Repository navigation
Conversation
Contributor
|
@Aqua-123 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 branch has not been 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.
Why
With raw cursor mode on,
PreviewCursorCachereturns no timeline, so paused and scrubbed preview frames useProjectUniforms::new. That passes the default event order, so each cursor lookup is a linear scan of all moves and clicks. #2489 fixed this for playback and export, and named paused preview of raw projects as out of scope.What changed
CursorEventOrderis public.CursorEventOrder::newholds the ordering check thatPrecomputedCursorTimeline::newdid before.ProjectUniforms::new_with_cursor_event_order.newcalls it with the default order, so its other callers are unchanged.PreviewCursorCache::event_ordercomputes the order once for each cursor events allocation. It keys on aWeakpointer, so it copies and keeps no events. The editor and preparing-preview fallbacks use it.Scope
raw_cursor: cursor.clone()copy inPrecomputedCursorTimeline::newis left for a follow-up. It costs about 4.7 ms once per segment at 60 min and touches about 25 call sites.Verification
benchmark_raw_cursor_preview_uniforms, ignored test). The one-time order check costs about 150 µs.raw_cursor_event_order_preserves_preview_uniforms_and_pixelscompares the uniforms and rendered pixels of both paths on ordered, shuffled, equal-timestamp and click-only data.preview_cursor_cache_bypasses_raw_mode_without_retaining_cursor_datastill checks that the cache keeps no events.

Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
This PR lets raw-mode preview frames reuse ordered cursor lookups instead of scanning all events.
No actionable issues found. Tests were inspected but not run.
Reviews (1) · Last reviewed commit: "perf(editor): use ordered cursor lookups..." · Reviewed by Greptile