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 01aaec5
☁️ 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 5 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem server error-paths not-found (solid) |
415.1 KB | 759.7 KB | -45.36% |
| ❌ | Memory | mem client preload-churn (vue) |
737 KB | 780.6 KB | -5.59% |
| ❌ | Simulation | ssr server-fn during document ssr (react) |
62.9 ms | 66 ms | -4.68% |
| ❌ | Memory | mem server error-paths redirect (react) |
197 KB | 204.2 KB | -3.55% |
| ❌ | Simulation | ssr control-flow error 500 (react) |
60.4 ms | 62.4 ms | -3.18% |
| ⚡ | Memory | mem server server-fn-churn (vue) |
4,147.3 KB | 263.1 KB | ×16 |
| ⚡ | Memory | mem server error-paths unmatched (vue) |
2,142.1 KB | 480.7 KB | ×4.5 |
| ⚡ | Memory | mem server peak-large-page (react) |
1,737.5 KB | 951.2 KB | +82.66% |
| ⚡ | Memory | mem server error-paths redirect (solid) |
388 KB | 272.3 KB | +42.5% |
| ⚡ | Memory | mem server error-paths redirect (vue) |
338.6 KB | 289.7 KB | +16.87% |
| ⚡ | Memory | mem server error-paths not-found (react) |
277.7 KB | 256 KB | +8.45% |
| ⚡ | Memory | mem client navigation-churn (vue) |
1.3 MB | 1.2 MB | +4.44% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing codex/fuse-dynamic-route-nodes (01aaec5) with main (697ebb6)
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