perf(router-core): wildcard suffix offset comparison - #8147
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
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. |
|
View your CI Pipeline Execution ↗ for commit 2121491
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview4 package(s) bumped directly, 19 bumped as dependents. 🟩 Patch bumps
|
Merging this PR will regress 6 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem server streaming-peak chunked (solid) |
30.6 MB | 33.5 MB | -8.78% |
| ❌ | Memory | mem client navigation-churn (solid) |
589.5 KB | 623.6 KB | -5.46% |
| ❌ | Memory | mem server server-fn-churn (vue) |
345.7 KB | 365 KB | -5.28% |
| ❌ | Memory | mem server error-paths redirect (react) |
296.3 KB | 309 KB | -4.1% |
| ❌ | Simulation | client-async-pipeline navigation loop (react) |
102.8 ms | 107.1 ms | -4.01% |
| ❌ | Memory | mem server error-paths not-found (solid) |
570 KB | 591.1 KB | -3.57% |
| ⚡ | Memory | mem server error-paths not-found (vue) |
2,071.7 KB | 490.4 KB | ×4.2 |
| ⚡ | Memory | mem server error-paths unmatched (react) |
1,830.3 KB | 439.1 KB | ×4.2 |
| ⚡ | Memory | mem server request-churn (react) |
712.7 KB | 666.1 KB | +7% |
| ⚡ | Memory | mem server error-paths redirect (vue) |
423.5 KB | 401.4 KB | +5.51% |
| ⚡ | Memory | mem server aborted-requests (react) |
865.1 KB | 838.7 KB | +3.14% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing perf/task8-wildcard-suffix-offsets (2121491) with main (cb281d7)
Summary
getNodeMatchallocatedparts.slice(index).join('/')per suffixed-wildcard candidate per stack frame — worst-case quadratic copying during matching.Decision gates
| workload | before | after | delta |
|---|---|---|---|
| match miss | 0.46 µs | 0.17 µs | 2.7× |
| match hit | 0.48 µs | 0.21 µs | 2.3× |
| realistic ~40-char paths | 0.46 µs | 0.31 µs | 1.5× |
(Bench note: an earlier run showed only 9.4% because memoization masked misses; restructured so candidates actually evaluate per frame.)
Correctness
Differential test vs vendored old implementation: 20k+ seeded generated tree/path/fuzzy comparisons + edge cases (case-insensitivity,
/in suffix, remainder shorter than suffix, trailing slash) — all identical.test:unit ✅ (1608 tests) · eslint ✅ · types ✅
Full details:
RESULT-perf-task8.mdon the branch.