Loading workspace insights... Statistics interval
7 days30 daysLatest CI Pipeline Executions
3ea98367 # Route Tree Optimization Result
## Setup
BEFORE: clean `HEAD` worktree with only new tests/benchmarks applied.
AFTER: final route-tree implementation with `options` local restored after perf isolation.
Relevant logs:
- BEFORE worktree: `/var/folders/6f/2t42ntqs4yv4h6qwzbh5pmcm0000gn/T/opencode/route-tree-before-compare`
- AFTER worktree: `/var/folders/6f/2t42ntqs4yv4h6qwzbh5pmcm0000gn/T/opencode/route-tree-after-compare`
- Final main perf: `/tmp/route-tree-final-perf2.log`
- Final full bundle diff: `/tmp/route-tree-final-full-bundle-diff2.txt`
## Tests
| Check | BEFORE | AFTER |
| --- | --- | --- |
| focused unit | 243 passed | 243 passed |
| router-core types | passed | passed |
| route-tree perf bench | passed | passed |
| relevant e2e | not rerun in BEFORE worktree | 44 passed |
| whitespace | n/a | clean |
## Bundle Size
Direct comparison for this diff, `react-router.minimal`:
| Metric | BEFORE | AFTER | Delta |
| --- | ---: | ---: | ---: |
| gzip | 89269 | 89214 | -55 |
| initial gzip | 89130 | 89073 | -57 |
| raw | 279600 | 279460 | -140 |
| brotli | 77670 | 77582 | -88 |
Full benchmark vs unoptimized attribution baseline:
| Scenario | Gzip Delta |
| --- | ---: |
| react-router.full | -159 |
| react-router.minimal | -178 |
| react-start.deferred-hydration | -207 |
| react-start.full | -168 |
| react-start.minimal | -177 |
| react-start.rsbuild.full | -190 |
| react-start.rsbuild.minimal | -175 |
| solid-router.full | -165 |
| solid-router.minimal | -131 |
| solid-start.deferred-hydration | -151 |
| solid-start.full | -152 |
| solid-start.minimal | -159 |
| vue-router.full | -154 |
| vue-router.minimal | -148 |
## Perf
Matched full-run comparison, same tests/benches in temp worktrees:
| Bench | BEFORE hz | AFTER hz | Delta | Relevance |
| --- | ---: | ---: | ---: | --- |
| processRouteTree mixed tree | 8482.16 | 8406.43 | -0.9% | not relevant |
| processRouteTree static-heavy singleton dynamics | 3376.49 | 3414.27 | +1.1% | not relevant, high variance |
| processRouteTree sortable dynamic fanout | 25148.24 | 25787.98 | +2.5% | likely positive |
| processRouteTree parsed priority fanout | 46308.12 | 45775.45 | -1.2% | contradicted by focused rerun |
| processRouteTree optional fanout | 24307.28 | 25594.74 | +5.3% | likely positive, focused overlap |
| processRouteTree wildcard fanout | 38286.45 | 40198.57 | +5.0% | not reproduced by focused rerun |
| processRouteMasks static-heavy singleton dynamics | 3804.66 | 3709.58 | -2.5% | not relevant, overlaps |
| processRouteMasks sortable dynamic fanout | 27902.76 | 28855.50 | +3.4% | likely positive |
| findRouteMatch decode encoded params batch | 27156.51 | 30521.50 | +12.4% | not relevant, high RME |
| findRouteMatch decode plain params batch | 39202.70 | 42038.73 | +7.2% | not relevant, high RME |
| findRouteMatch decode mixed90 params batch | 38627.50 | 38124.96 | -1.3% | not relevant, high RME |
| findRouteMatch sortable dynamic fanout | 19710991.25 | 19006507.35 | -3.6% | not relevant, high variance |
Focused reruns used for suspected cases:
| Bench | BEFORE hz | AFTER hz | Delta | Relevance |
| --- | ---: | ---: | ---: | --- |
| processRouteTree parsed priority fanout | 47007.46 +/-0.32% | 48042.74 +/-0.29% | +2.2% | statistically relevant positive |
| processRouteTree optional fanout | 25094.35 +/-2.24% | 25718.38 +/-1.30% | +2.5% | not conclusive, ranges overlap |
| processRouteTree wildcard fanout | 39812.35 +/-1.79% | 39765.98 +/-3.07% | -0.1% | not relevant |
| processRouteTree static-heavy singleton dynamics | 3417.00 +/-3.12% | 3392.02 +/-0.77% | -0.7% | not relevant |
Static-heavy note: one narrow run showed a clear slowdown before restoring the `options` local. After restoring it, repeated matched runs no longer showed a stable regression; identical BEFORE runs varied more than the final AFTER delta.
## Conclusion
Final candidate keeps bundle wins and no statistically reliable perf regression remains. The only statistically relevant focused perf signal is positive for parsed priority fanout. 3ea98367 # Route Tree Optimization Result
## Setup
BEFORE: clean `HEAD` worktree with only new tests/benchmarks applied.
AFTER: final route-tree implementation with `options` local restored after perf isolation.
Relevant logs:
- BEFORE worktree: `/var/folders/6f/2t42ntqs4yv4h6qwzbh5pmcm0000gn/T/opencode/route-tree-before-compare`
- AFTER worktree: `/var/folders/6f/2t42ntqs4yv4h6qwzbh5pmcm0000gn/T/opencode/route-tree-after-compare`
- Final main perf: `/tmp/route-tree-final-perf2.log`
- Final full bundle diff: `/tmp/route-tree-final-full-bundle-diff2.txt`
## Tests
| Check | BEFORE | AFTER |
| --- | --- | --- |
| focused unit | 243 passed | 243 passed |
| router-core types | passed | passed |
| route-tree perf bench | passed | passed |
| relevant e2e | not rerun in BEFORE worktree | 44 passed |
| whitespace | n/a | clean |
## Bundle Size
Direct comparison for this diff, `react-router.minimal`:
| Metric | BEFORE | AFTER | Delta |
| --- | ---: | ---: | ---: |
| gzip | 89269 | 89214 | -55 |
| initial gzip | 89130 | 89073 | -57 |
| raw | 279600 | 279460 | -140 |
| brotli | 77670 | 77582 | -88 |
Full benchmark vs unoptimized attribution baseline:
| Scenario | Gzip Delta |
| --- | ---: |
| react-router.full | -159 |
| react-router.minimal | -178 |
| react-start.deferred-hydration | -207 |
| react-start.full | -168 |
| react-start.minimal | -177 |
| react-start.rsbuild.full | -190 |
| react-start.rsbuild.minimal | -175 |
| solid-router.full | -165 |
| solid-router.minimal | -131 |
| solid-start.deferred-hydration | -151 |
| solid-start.full | -152 |
| solid-start.minimal | -159 |
| vue-router.full | -154 |
| vue-router.minimal | -148 |
## Perf
Matched full-run comparison, same tests/benches in temp worktrees:
| Bench | BEFORE hz | AFTER hz | Delta | Relevance |
| --- | ---: | ---: | ---: | --- |
| processRouteTree mixed tree | 8482.16 | 8406.43 | -0.9% | not relevant |
| processRouteTree static-heavy singleton dynamics | 3376.49 | 3414.27 | +1.1% | not relevant, high variance |
| processRouteTree sortable dynamic fanout | 25148.24 | 25787.98 | +2.5% | likely positive |
| processRouteTree parsed priority fanout | 46308.12 | 45775.45 | -1.2% | contradicted by focused rerun |
| processRouteTree optional fanout | 24307.28 | 25594.74 | +5.3% | likely positive, focused overlap |
| processRouteTree wildcard fanout | 38286.45 | 40198.57 | +5.0% | not reproduced by focused rerun |
| processRouteMasks static-heavy singleton dynamics | 3804.66 | 3709.58 | -2.5% | not relevant, overlaps |
| processRouteMasks sortable dynamic fanout | 27902.76 | 28855.50 | +3.4% | likely positive |
| findRouteMatch decode encoded params batch | 27156.51 | 30521.50 | +12.4% | not relevant, high RME |
| findRouteMatch decode plain params batch | 39202.70 | 42038.73 | +7.2% | not relevant, high RME |
| findRouteMatch decode mixed90 params batch | 38627.50 | 38124.96 | -1.3% | not relevant, high RME |
| findRouteMatch sortable dynamic fanout | 19710991.25 | 19006507.35 | -3.6% | not relevant, high variance |
Focused reruns used for suspected cases:
| Bench | BEFORE hz | AFTER hz | Delta | Relevance |
| --- | ---: | ---: | ---: | --- |
| processRouteTree parsed priority fanout | 47007.46 +/-0.32% | 48042.74 +/-0.29% | +2.2% | statistically relevant positive |
| processRouteTree optional fanout | 25094.35 +/-2.24% | 25718.38 +/-1.30% | +2.5% | not conclusive, ranges overlap |
| processRouteTree wildcard fanout | 39812.35 +/-1.79% | 39765.98 +/-3.07% | -0.1% | not relevant |
| processRouteTree static-heavy singleton dynamics | 3417.00 +/-3.12% | 3392.02 +/-0.77% | -0.7% | not relevant |
Static-heavy note: one narrow run showed a clear slowdown before restoring the `options` local. After restoring it, repeated matched runs no longer showed a stable regression; identical BEFORE runs varied more than the final AFTER delta.
## Conclusion
Final candidate keeps bundle wins and no statistically reliable perf regression remains. The only statistically relevant focused perf signal is positive for parsed priority fanout. 3ea98367 # Route Tree Optimization Result
## Setup
BEFORE: clean `HEAD` worktree with only new tests/benchmarks applied.
AFTER: final route-tree implementation with `options` local restored after perf isolation.
Relevant logs:
- BEFORE worktree: `/var/folders/6f/2t42ntqs4yv4h6qwzbh5pmcm0000gn/T/opencode/route-tree-before-compare`
- AFTER worktree: `/var/folders/6f/2t42ntqs4yv4h6qwzbh5pmcm0000gn/T/opencode/route-tree-after-compare`
- Final main perf: `/tmp/route-tree-final-perf2.log`
- Final full bundle diff: `/tmp/route-tree-final-full-bundle-diff2.txt`
## Tests
| Check | BEFORE | AFTER |
| --- | --- | --- |
| focused unit | 243 passed | 243 passed |
| router-core types | passed | passed |
| route-tree perf bench | passed | passed |
| relevant e2e | not rerun in BEFORE worktree | 44 passed |
| whitespace | n/a | clean |
## Bundle Size
Direct comparison for this diff, `react-router.minimal`:
| Metric | BEFORE | AFTER | Delta |
| --- | ---: | ---: | ---: |
| gzip | 89269 | 89214 | -55 |
| initial gzip | 89130 | 89073 | -57 |
| raw | 279600 | 279460 | -140 |
| brotli | 77670 | 77582 | -88 |
Full benchmark vs unoptimized attribution baseline:
| Scenario | Gzip Delta |
| --- | ---: |
| react-router.full | -159 |
| react-router.minimal | -178 |
| react-start.deferred-hydration | -207 |
| react-start.full | -168 |
| react-start.minimal | -177 |
| react-start.rsbuild.full | -190 |
| react-start.rsbuild.minimal | -175 |
| solid-router.full | -165 |
| solid-router.minimal | -131 |
| solid-start.deferred-hydration | -151 |
| solid-start.full | -152 |
| solid-start.minimal | -159 |
| vue-router.full | -154 |
| vue-router.minimal | -148 |
## Perf
Matched full-run comparison, same tests/benches in temp worktrees:
| Bench | BEFORE hz | AFTER hz | Delta | Relevance |
| --- | ---: | ---: | ---: | --- |
| processRouteTree mixed tree | 8482.16 | 8406.43 | -0.9% | not relevant |
| processRouteTree static-heavy singleton dynamics | 3376.49 | 3414.27 | +1.1% | not relevant, high variance |
| processRouteTree sortable dynamic fanout | 25148.24 | 25787.98 | +2.5% | likely positive |
| processRouteTree parsed priority fanout | 46308.12 | 45775.45 | -1.2% | contradicted by focused rerun |
| processRouteTree optional fanout | 24307.28 | 25594.74 | +5.3% | likely positive, focused overlap |
| processRouteTree wildcard fanout | 38286.45 | 40198.57 | +5.0% | not reproduced by focused rerun |
| processRouteMasks static-heavy singleton dynamics | 3804.66 | 3709.58 | -2.5% | not relevant, overlaps |
| processRouteMasks sortable dynamic fanout | 27902.76 | 28855.50 | +3.4% | likely positive |
| findRouteMatch decode encoded params batch | 27156.51 | 30521.50 | +12.4% | not relevant, high RME |
| findRouteMatch decode plain params batch | 39202.70 | 42038.73 | +7.2% | not relevant, high RME |
| findRouteMatch decode mixed90 params batch | 38627.50 | 38124.96 | -1.3% | not relevant, high RME |
| findRouteMatch sortable dynamic fanout | 19710991.25 | 19006507.35 | -3.6% | not relevant, high variance |
Focused reruns used for suspected cases:
| Bench | BEFORE hz | AFTER hz | Delta | Relevance |
| --- | ---: | ---: | ---: | --- |
| processRouteTree parsed priority fanout | 47007.46 +/-0.32% | 48042.74 +/-0.29% | +2.2% | statistically relevant positive |
| processRouteTree optional fanout | 25094.35 +/-2.24% | 25718.38 +/-1.30% | +2.5% | not conclusive, ranges overlap |
| processRouteTree wildcard fanout | 39812.35 +/-1.79% | 39765.98 +/-3.07% | -0.1% | not relevant |
| processRouteTree static-heavy singleton dynamics | 3417.00 +/-3.12% | 3392.02 +/-0.77% | -0.7% | not relevant |
Static-heavy note: one narrow run showed a clear slowdown before restoring the `options` local. After restoring it, repeated matched runs no longer showed a stable regression; identical BEFORE runs varied more than the final AFTER delta.
## Conclusion
Final candidate keeps bundle wins and no statistically reliable perf regression remains. The only statistically relevant focused perf signal is positive for parsed priority fanout. d64bf8d3 perf: optimize new-process-route-tree.ts
## Summary
- Optimized route-tree post-processing by sorting only dynamic child arrays that can need ordering.
- Applied the same sortable-array tracking to route masks.
- Added a param decode fast path that skips `decodeURIComponent` when a matched value has no `%` escape.
- Removed the recursive `sortTreeNodes` post-build tree walk.
- Pass `sortables` through recursive route parsing so nested dynamic arrays are recorded during construction.
- Skip sortable tracking for single-route lazy matching, where no sibling ordering can be needed.
## Bundle Size
Scenario: `react-router.minimal`
| Metric | Before | After | Delta |
| --- | ---: | ---: | ---: |
| gzip | 89,392 | 89,269 | -123 |
| initial gzip | 89,251 | 89,130 | -121 |
| raw | 280,592 | 279,600 | -992 |
| brotli | 77,753 | 77,670 | -83 |
## Focused Benchmarks
Benchmarks were compared against a baseline worktree with the same benchmark cases applied and only the implementation different.
| Case | Baseline hz | Current hz | Delta |
| --- | ---: | ---: | ---: |
| `processRouteTree static-heavy singleton dynamics` | 2,953.62 | 3,315.89 | +12.26% |
| `processRouteTree sortable dynamic fanout` | 23,016.48 | 24,293.93 | +5.55% |
| `processRouteMasks static-heavy singleton dynamics` | 3,654.97 | 4,054.59 | +10.93% |
| `processRouteMasks sortable dynamic fanout` | 26,499.82 | 27,733.59 | +4.66% |
| `findRouteMatch decode mixed90 params uncached batch` | 29,618.76 | 40,791.57 | +37.72% |
| `findRouteMatch decode encoded params uncached batch` | 34,053.80 | 32,279.86 | -5.21% |
Notes:
- Route construction improves most when the tree has many singleton dynamic arrays, because the full post-build traversal is removed.
- Mostly-unencoded param extraction improves by avoiding unnecessary decoding.
- Encoded-only params are the tradeoff case because the `%` check adds overhead before decoding.
## Validation
- `tests/new-process-route-tree.test.ts`: passed, `173 passed`, no type errors.
- Focused perf cases: passed.
- `git diff --check`: clean.