perf(cg): full-viewport frame plan fast path#615
Conversation
… snapshot When the viewport fully contains the scene (fit zoom), skip the R-tree traversal and index sort entirely — return 0..n in O(1) instead of O(n log n). Guarded by R-tree size equality check for layers without render bounds. Partial-viewport frames now use sort_unstable (pdqsort) instead of stable merge sort — 2-3x faster for integer data. Pan and zoom image caches share a single image_snapshot() call on non-zoom frames, avoiding a redundant GPU handle allocation. Measured on 01-135k (135K nodes): - rt_pan_slow_fit queue: 1598→485 us (-70%) - rt_pan_slow_fit p95: 6317→1199 us (-81%) - rt_pan_slow_zoomed p50: 300→151 us (-50%) - rt_pan_fast_fit p50: 82→41 us (-50%) - fl_16ms p50: 97→61 us (-37%) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughOptimized GPU snapshot caching and frame visibility selection in the renderer. A single GPU Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
0..nin O(1) instead of O(n log n). Guarded by R-tree size equality check for correctness when layers lack render bounds.sort_unstable: Partial-viewport frames use pdqsort instead of stable merge sort — 2-3x faster for integer data, no stability needed for draw-order indices.image_snapshot()call on non-zoom frames, avoiding a redundant GPU handle allocation.Measured on 01-135k (135K nodes):
Zero test regressions (281 unit + 67 doc/integration). No new clippy warnings.
Test plan
cargo test -p cg— all passcargo check -p cg -p grida-canvas-wasm -p grida-dev— all compilecargo clippy -p cg --no-deps— no new warnings (305, down from 306)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Performance
Documentation