Repository navigation
perf(rendering): reduce late-seek stalls in dense auto-zoom timelines - #3232
Merged
richiemcilroy merged 1 commit intoOct 25, 2026
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. |
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.
First seeks near the end of a densely edited project can spend hundreds of milliseconds preparing automatic zooms. Each 60 Hz simulation step scans the entire timeline-to-recording map, including intervals that cannot contain the requested time.
Validate once that mapping starts and ends are finite and nondecreasing. During simulation, use two binary bounds to pass only the potentially active overlapping intervals to the existing mapper. Keep the full scan for irregular/nonfinite maps, gaps, outside times and entry boundaries, preserving the mapper's first-entry shortcut and signed-zero arithmetic. The same clip preference and spring calculations run on the selected range. The map remains owned by the existing immutable zoom timeline; there is no new public API or cache lifecycle.
Native preview measurements
This measures the real
EditorInstancepreview path from sending a seek request to receiving its rendered-frame callback, including decoding, zoom preparation, uniforms, rendering and readback. It excludes editor construction and the initial frame at time 0. Every returned-frame fingerprint matches across both revisions and profiles.Linux x86_64, AMD EPYC 9V74, two-CPU quota, affinity CPUs 0,1, Rust 1.88.0. Forced software Vulkan with Mesa 25.0.7 Lavapipe and two rasterizer threads. Five alternating independent processes per version/profile/workload; one first late seek per fresh editor; table shows process medians. UI window presentation and physical GPU performance were not measured.
Baseline
94a800cbac807f35a8bd3a862dd5d24853d8152c. The final branch is rebased onto current main. Subsequent caption projection, transcription and audio-cache changes are outside the fixture's exercised paths (no captions/audio); upstream zoom mapping code and compiler profiles are unchanged. Root release is opt-level=s/thin LTO/one codegen unit. The level-3 control overrides only cap-rendering; other packages retain the root profile.The dense fixture improves 2.7–2.9×, saving about 250–280ms on the first jump to 95% of the timeline. The shorter fixture saves only 1.6–2.2ms; it is a control rather than a noticeable user-facing claim. Editor-construction medians are 3.4–13.1% slower (4–17ms); those raw timings are retained, and no startup speedup is claimed. The meaningful result is removing the late-seek hitch in dense timelines.
Fixtures are synthetic: four recording sources sharing a generated 900-second 320×180 H.264 1fps intraframe clip, 100/1,000 timeline cuts, and 30 automatic zoom intervals covering 85% of the timeline. Cursor motion is deterministic at60 Hz; camera/cursor drawing are disabled and there are no audio tracks. The benchmark warms frame 0, then immediately requests the frame at95% at 30fps and 640×360. It compares complete visible-frame pixel fingerprints. The scope is the first seek/rebuild, since later seeks can reuse precomputed zoom samples.
This is distinct from #3225's cursor-spring reuse in preview/thumbnail: it changes zoom time-map lookup in zoom_spring.rs, not cursor interpolation/caching.
Correctness and checks
cargo fmt --all --check, rendering all-target check, strict rendering-library Clippy and strict editor all-target Clippy with--no-depspass.layers/blur.rs:143,layers/camera3d.rs:164), also warned on the baseline. No suppression or unrelated cleanup is included.Reproduction
Build this PR's example on both revisions, keeping only the example on the baseline. Save each binary separately before rebuilding:
Native dependencies follow the contributor guide. For this headless result, point VK_DRIVER_FILES at a Lavapipe ICD, set CAP_RENDER_FORCE_SOFTWARE_ADAPTER=1 and LP_NUM_THREADS=2, and provide a writable XDG_RUNTIME_DIR. On a machine with a native GPU, the example can use the default adapter. Set CAP_ZOOM_DURATION=600 and CAP_ZOOM_CLIPS=100 for the shorter control. Alternate five saved baseline/head processes, compare
fingerprint, and take medians ofseek_seconds.startup_secondsis recorded separately.Risk is confined to narrowing the mapper's search domain. Both endpoint orderings are validated once, the original arithmetic and source precedence are reused, and cases that cannot safely narrow retain the original full input. No frame sampling rate, spring behavior, decoder, project format or GPU shader changes.


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
This PR reduces repeated timeline scans while preparing automatic zooms for late seeks.
No actionable issues found. Tests and benchmark timings were not independently rerun.
Reviews (1) · Last reviewed commit: "perf(rendering): narrow time mappings fo..." · Reviewed by Greptile