Repository navigation
perf(project): resolve style groups in one pass - #2957
Merged
richiemcilroy merged 2 commits intoOct 23, 2026
Merged
Conversation
Contributor
|
@OptimistOtaku is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Frame settings resolve background, camera, and cursor styles with three separate scans of the same style segments. Playback and export pay for all three even in gaps where no style is active. With 200 style segments, the committed release benchmark reduces an inactive lookup from 2.169 µs to 0.770 µs (2.82× faster).
Select the winning segment for each group in one pass, then apply only those overrides. Track priority, later start, and later original index still decide each group independently. Numeric comparison preserves tied signed-zero starts. Inactive/invalid segments and non-finite query times remain excluded, and frames without an applicable override still borrow the base configuration. The existing single-group lookup remains available for cursor-only and camera-padding queries.
Benchmark
Windows x86_64, Ryzen 5 5600H, Rust 1.88.0 GNU, repository release profile (
opt-level=s, thin LTO). The benchmark compares the previousstyle_atimplementation with the new method in the same binary. Seven alternating paired samples after warmups; medians shown. Each sample uses 10,000 inactive queries or 1,000 active queries. Complete configurations are checked for equivalence before timing, and owned results are dropped within the measurement.Active styles still clone the project configuration, so the gain is concentrated in inactive queries; the largest active control was approximately 1% slower. This measures style resolution in the shared frame-settings path, not overall rendering or FPS.
cargo test -p cap-project --locked --release --lib benchmark_style_resolution -- --ignored --nocaptureValidation
cargo fmt --allcargo check -p cap-project --lockedcargo test -p cap-project --locked --lib: 167 passed, three benchmarks ignored by default; the style benchmark was run separately.cargo clippy -p cap-project --all-targets --locked -- -D warningsgit diff --checkThe differential test compares resolved configurations and borrowed/owned behavior against the original implementation, including overlapping tracks, independent group winners, tied starts, signed zero, disabled/invalid intervals, exact boundaries, and NaN/infinite query times. Existing style precedence, padding, migration, and serialization tests pass. The native GPUI app was not launched locally.
This branch is based directly on upstream
mainand is independent of #2956.

Confidence Score: 5/5
This PR appears safe to merge; no actionable issues were found.Summary
style_atnow selects background, camera, and cursor overrides in one scan instead of three.Reviews (1) · Last reviewed commit: "perf(project): resolve style groups in o..." · Reviewed by Greptile