perf: layout stability signatures, content-keyed packets, hot-path fixes#226
Conversation
…hot-path fixes Five-part performance audit targeting the submit/render pipeline: 1. beginFrame slot reclamation — reclaim READY→DONE SAB slots so the native backend can reuse them without growing the ring buffer. 2. Content-based render packet keying — replace identity (WeakMap) packet cache with FNV-1a content hashing so structurally-identical frames reuse cached packets. Adds a hashTextProps fast path for text/richText nodes (6 visual props) to avoid generic Object.keys iteration. 3. Clip sentinel push — replace O(n) splice with O(1) push for clip open/close sentinels in the container render path. 4. Layout stability signatures — FNV-1a hash over each subtree's layout-affecting props; skip relayout when signature is unchanged. Text width is treated as paint-only (even inside row/grid parents) to avoid O(frames) relayout in scrolling lists. 5. Benchmark instrumentation — per-scenario perf-counter snapshots, execution-mode override env var, and bench-full-compare script. PTY results (vs pre-audit baseline): virtual-list 1.03 ms → 649 µs (−37 %) table 450 µs → 462 µs (flat) frame-fill d=1 457 µs → 456 µs (flat) fps-stream 1.11 ms → 1.07 ms (−4 %)
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (24)
📝 WalkthroughWalkthroughThis PR introduces comprehensive performance instrumentation, profiling integration, and optimization across benchmarking and core rendering. Changes include new benchmarking npm scripts and a full-compare tool, Rezi performance profiling hooks integrated into all benchmark scenarios, layout stability signature optimizations with conditional text-width handling, render packet caching via memoization for text nodes, SAB slot acquisition tracking with metrics, container rendering optimizations to avoid no-op clip operations, and performance counter instrumentation throughout the layout and rendering pipeline. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Summary
Five-part performance audit of the submit/render pipeline:
hashTextPropsfast path for text/richText (6 visual props only)bench-full-comparescriptPTY benchmark results (vs pre-audit baseline)
Test plan
layout.stability-signature.test.ts— 95/95renderPackets.test.ts— 5/5renderer.clip.test.ts— 18/18worker_integration.test.ts— 29/29renderer.damage.test.tsfrom clip sentinel change)Summary by CodeRabbit
Release Notes
Performance
New Features