perf(router): consolidate indexed Links into immutable subscription descriptors - #8570
schiller-manuel wants to merge 9 commits into
Conversation
* refactor: reduce centralized Link state bundle cost * refactor: further reduce Link state bundle cost (#8563) * refactor: further reduce Link state bundle cost * refactor: compact Link internals with tuples (#8564) * refactor: compact Link internals with tuples * refactor: reduce Link registry and adapter overhead (#8565)
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
🚀 Changeset Version Preview6 package(s) bumped directly, 18 bumped as dependents. 🟩 Patch bumps
|
|
View your CI Pipeline Execution ↗ for commit 2184c2e
☁️ 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. |
Merging this PR will regress 14 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | client-links navigation loop (solid) |
451.9 ms | 685.4 ms | -34.07% |
| ❌ | Simulation | client-route-tree-scale navigation loop (solid) |
262.3 ms | 388.8 ms | -32.54% |
| ❌ | Simulation | client-async-pipeline navigation loop (solid) |
126.7 ms | 176.3 ms | -28.16% |
| ❌ | Simulation | client-rewrites navigation loop (solid) |
152 ms | 207.6 ms | -26.78% |
| ❌ | Simulation | hydrate restored route state and mixed Links (solid) |
400 ms | 533.9 ms | -25.07% |
| ❌ | Simulation | client-side navigation loop (solid) |
192.6 ms | 243.1 ms | -20.76% |
| ❌ | Simulation | client-control-flow navigation loop (solid) |
119.1 ms | 149.9 ms | -20.56% |
| ❌ | Simulation | client-head navigation loop (solid) |
419.3 ms | 486.1 ms | -13.74% |
| ❌ | Simulation | client-history navigation loop (solid) |
105.6 ms | 120.2 ms | -12.11% |
| ❌ | Simulation | client-search-params navigation loop (solid) |
251.2 ms | 285.5 ms | -12.02% |
| ❌ | Simulation | client-loaders navigation loop (solid) |
157.5 ms | 177.1 ms | -11.08% |
| ❌ | Simulation | client-preload interaction loop (solid) |
159.5 ms | 176 ms | -9.36% |
| ❌ | Simulation | client-nested-params navigation loop (solid) |
777.2 ms | 805.3 ms | -3.49% |
| ❌ | Memory | mem server error-paths unmatched (react) |
858.8 KB | 889.8 KB | -3.48% |
| ⚡ | Simulation | client-links navigation loop (vue) |
294.1 ms | 71.6 ms | ×4.1 |
| ⚡ | Memory | mem server streaming-peak chunked (react) |
642.3 KB | 350 KB | +83.54% |
| ⚡ | Simulation | ssr request loop (solid) |
256.8 ms | 206.1 ms | +24.57% |
| ⚡ | Simulation | client-route-tree-scale navigation loop (vue) |
143.1 ms | 115.4 ms | +24.07% |
| ⚡ | Simulation | client-links navigation loop (react) |
92.8 ms | 75.9 ms | +22.22% |
| ⚡ | Simulation | client-control-flow navigation loop (vue) |
74.7 ms | 63.8 ms | +17.19% |
| ... | ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing codex/link-indexed-lazy-publication (82f3fe3) with main (41ebd28)
Footnotes
-
3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
…escriptors Restore eager preparation and atomic publication before observer notification. Unify the input descriptor and subscription lifetime across React, Solid and Vue, removing React's extra memo/layout-effect adoption and core view indirection. Preserve dependency masks, pathname indexing, error ownership and settlement guards. Adapt internal fixture setup without weakening the settlement assertions.
Changes
A smaller alternative to the fast #8557 implementation, built from its head
8ab0b43503498dd125a616c76089c59dc5a0abca. This PR includes its changes/history and preserves attribution. #8557 and #8566 are untouched.Runtime target: #8557, not merely main. Keep actual build-read masks, pathname candidate indexes, retained-Link filtering, departure reconciliation, native callback dependencies, and one subscription per Link.
Current revision:
2184c2e56ab4463c8163f014fb3415c771884e4buseSyncExternalStoreown registration/replacement. Remove the separate store memo and layout-effect view adoption.No dependencies, lockfiles, workflows, or public Link props changed.
Iteration record and corrected comparison
The initial commit
8a4bb52tried lazy derivation after indexed invalidation. CI rejected it:prepare-reentryexposed a callback-triggered successor navigation starting too late. Its bundle report showed no meaningful improvement at displayed precision. That experiment has been replaced, not accepted.The current algorithm passed 25 local mock-router contract tests, including eager callback reentry, native invalidation acceptance, atomic sibling reads, resolve/reject/supersession settlement, immutable speculative inputs, equal-output notification suppression, cleanup, history formatting and a 1,000-Link retained grid. These are algorithm checks, not framework or production measurements.
Correction to the earlier description: the freshly fetched #8557 CodSpeed report shows React client-links 76.5 ms, against main 92.8 ms. The previously quoted 38.3 ms was not supported by that report and must not be used as the baseline. This PR's first (rejected) revision reported 76.4 ms. Only results attached to the current head establish its performance; cross-run measurements also need normal benchmarking caution.
Required validation
GitHub CI is the framework/build/production measurement environment for this iteration. Keep draft until the above checks establish the result. The inherited architecture/measurement reports describe #8557, not this revision. Existing published-code changesets remain included.