perf(router-core): fuse dynamic route node construction - #7974
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughChangesRoute-node construction optimization
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant RouteTreeProcessing
participant parseSegments
participant DynamicSiblingLists
RouteTreeProcessing->>parseSegments: parse routes and collect dynamic lists
parseSegments->>DynamicSiblingLists: register lists with multiple entries
RouteTreeProcessing->>DynamicSiblingLists: sort collected lists after parsing
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
|
View your CI Pipeline Execution ↗ for commit c4597ae
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview5 package(s) bumped directly, 18 bumped as dependents. 🟩 Patch bumps
|
Bundle Size Benchmarks
The following scenarios have bundle-size changes compared with the baseline:
Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better. |
Merging this PR will regress 7 benchmarks
|
Summary
parseSegmentsBundle size
react-router.minimal:All 17 scenarios improve by 55–125 B gzip and 870–904 B raw. Brotli is mixed: -180 to +83 B, with 6 small regressions.
Hunk attribution on the minimal scenario: sparse sorting -16 B isolated, cached fields -1 B isolated, first two together -19 B, fused construction -36 B incremental.
Runtime
Across three construction-benchmark runs, the complete group is approximately 2–9% faster than baseline over static, dense-dynamic, reused-shape, and route-mask inputs. Fusion alone is a small construction slowdown (+0.5% to +3.2% in cumulative medians), offset by the sparse-sort and cached-read changes; it is included for bundle size, not claimed as an independent runtime win.
The full measurements and methodology are in
RESULT-optimization-fused-route-nodes.md.Validation
Summary by CodeRabbit
Bug Fixes
Performance