perf: use slice for proven ordered bounds - #7977
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 |
|
View your CI Pipeline Execution ↗ for commit ae8b039
☁️ Nx Cloud last updated this comment at |
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. |
🚀 Changeset Version Preview5 package(s) bumped directly, 18 bumped as dependents. 🟩 Patch bumps
|
Merging this PR will regress 6 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem server request-churn (solid) |
425.2 KB | 2,908.5 KB | -85.38% |
| ❌ | Memory | mem server error-paths redirect (vue) |
338.6 KB | 524.8 KB | -35.48% |
| ❌ | Memory | mem client unique-location-churn (solid) |
341.2 KB | 455.5 KB | -25.08% |
| ❌ | Memory | mem server error-paths unmatched (react) |
317.5 KB | 356.9 KB | -11.04% |
| ❌ | Memory | mem client unique-location-churn (react) |
665 KB | 718.9 KB | -7.5% |
| ❌ | Memory | mem client navigation-churn (solid) |
580.3 KB | 619.9 KB | -6.4% |
| ⚡ | Memory | mem server server-fn-churn (vue) |
4,147.3 KB | 270.5 KB | ×15 |
| ⚡ | Memory | mem server error-paths unmatched (vue) |
2,142.1 KB | 479.1 KB | ×4.5 |
| ⚡ | Memory | mem server peak-large-page (react) |
1,737.5 KB | 953.7 KB | +82.19% |
| ⚡ | Memory | mem server error-paths redirect (solid) |
388 KB | 278.6 KB | +39.29% |
| ⚡ | Memory | mem client navigation-churn (vue) |
1.3 MB | 1.2 MB | +3.9% |
| ⚡ | Simulation | ssr control-flow unmatched 404 (react) |
58.1 ms | 56.1 ms | +3.59% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing codex/shorter-string-operations (ae8b039) with main (697ebb6)
There was a problem hiding this comment.
Nx Cloud has identified a possible root cause for your failed CI:
We classified this failure as an environment issue unrelated to the PR. The error originates in a stale e2e-utils dist artifact missing the toRuntimePath export — a build environment problem entirely outside the scope of the substring → slice optimization changes in @tanstack/router-core. No changes to this PR are needed to resolve it.
No code changes were suggested for this issue.
Trigger a rerun:
🎓 Learn more about Self-Healing CI on nx.dev
Summary
Replace 24 internal
substringcalls with shorterslicecalls only where both bounds are proven non-negative and ordered.The five extraction sites whose bounds can reverse remain
substring; focused tests cover overlapping named, optional, and wildcard affixes plus Unicode lowercase expansion. No public API or browser-support floor changes.Bundle impact
Measured from clean commit
ae8b0397cf0a6813ea380fae4903371fd5d83ae5against exactmainbase697ebb6ddbd433d052b6b4707938a5c595865d58:A nearby
indexOf→includesgroup was dropped after its isolated performance result was not confidently neutral.Performance and validation
sliceaverages 10.34% faster thansubstringacross four final runsFull attribution, matrix, performance results, and rejected variants are in
RESULT-optimization-shorter-string-operations.md.