Skip to content

perf(solid-router): avoid republishing unchanged link state - #8005

Draft
Sheraff wants to merge 2 commits into
mainfrom
agent/solid-link-state-memo
Draft

perf(solid-router): avoid republishing unchanged link state#8005
Sheraff wants to merge 2 commits into
mainfrom
agent/solid-link-state-memo

Conversation

@Sheraff

@Sheraff Sheraff commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • derive a Solid link's href, external destination, and active state in one memoized tuple
  • preserve the tuple identity when those observable values do not change
  • keep the built destination memo independent so preloading always receives the latest location
  • add regressions for stable inactive links, fuzzy-active descendant navigation, and preload freshness

Why

Persistent links rebuild their destination as router state changes. Even when the resulting href and active state remain identical, publishing fresh adapter state causes downstream prop work. Keeping this projection inside the existing link memo architecture lets Solid suppress that work without adding caches or side tables.

Impact

The isolated local client-nav links benchmark improved from the captured 41.681 ms baseline to 17.949 ms mean on this branch (about 56.9% faster). The solid-router.minimal bundle remained at 34,015 bytes gzip.

Validation

  • @tanstack/solid-router:test:unit: 56 client files / 852 tests passed; 3 server files / 3 tests passed
  • @tanstack/solid-router:test:types: TypeScript 5.6 through 7.0 passed
  • @tanstack/solid-router:test:eslint: zero errors (existing warnings remain)
  • @benchmarks/client-nav-links-solid:build:client
  • focused vitest bench links run
  • solid-router.minimal bundle-size scenario
  • git diff --check

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 88fec8b5-1575-4ad5-8d2a-b854fe4eaf3c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 1c80c35

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 8m 38s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 46s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-08 14:16:17 UTC

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: 0086a5c01d6a
  • Measured at: 2026-08-08T14:08:54.844Z
  • Baseline source: history:c568caf3f376
  • Dashboard: bundle-size history

The following scenarios have bundle-size changes compared with the baseline:

Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
solid-router.minimal 33.21 KiB -4 B (-0.01%) 33.09 KiB 96.39 KiB 29.99 KiB █████████▁▁▁
solid-router.full 38.07 KiB +22 B (+0.06%) 37.94 KiB 111.02 KiB 34.24 KiB █████████▁▁▁
solid-start.minimal 45.96 KiB +17 B (+0.04%) 45.83 KiB 137.39 KiB 40.84 KiB █████████▁▁▁
solid-start.deferred-hydration 49.03 KiB +24 B (+0.05%) 45.89 KiB 144.85 KiB 43.71 KiB █████████▁▁▁
solid-start.full 51.03 KiB +12 B (+0.02%) 50.90 KiB 152.78 KiB 45.21 KiB █████████▁▁▁

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.

@pkg-pr-new

pkg-pr-new Bot commented Aug 8, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@8005

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8005

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8005

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@8005

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@8005

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@8005

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@8005

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8005

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@8005

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@8005

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@8005

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@8005

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@8005

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@8005

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@8005

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@8005

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@8005

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@8005

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8005

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@8005

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8005

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@8005

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8005

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8005

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@8005

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@8005

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@8005

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@8005

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8005

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@8005

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@8005

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8005

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@8005

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@8005

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8005

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@8005

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8005

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8005

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@8005

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@8005

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@8005

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@8005

commit: 1c80c35

@codspeed-hq

codspeed-hq Bot commented Aug 8, 2026

Copy link
Copy Markdown

Merging this PR will regress 3 benchmarks

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 15 improved benchmarks
❌ 6 (👁 3) regressed benchmarks
✅ 159 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory mem client unique-location-churn (solid) 341.6 KB 511.1 KB -33.16%
Simulation ssr dehydrate rich types (solid) 87.3 ms 97.3 ms -10.23%
Simulation ssr dehydrate plain control (solid) 119.6 ms 129.2 ms -7.49%
Simulation client-links navigation loop (solid) 380.4 ms 146.9 ms ×2.6
Memory mem server error-paths redirect (solid) 588.2 KB 288.8 KB ×2
Simulation client-side navigation loop (solid) 88 ms 64.7 ms +36.05%
Simulation client-route-tree-scale navigation loop (solid) 121 ms 92.5 ms +30.81%
Simulation client-async-pipeline navigation loop (solid) 66.4 ms 52.4 ms +26.54%
Simulation client-control-flow navigation loop (solid) 56.3 ms 45.1 ms +24.66%
Simulation client-rewrites navigation loop (solid) 76.3 ms 63.7 ms +19.71%
Simulation client-history navigation loop (solid) 53.8 ms 46.3 ms +16.15%
Simulation client-loaders navigation loop (solid) 80 ms 69.8 ms +14.57%
Simulation client-preload interaction loop (solid) 70.6 ms 63 ms +12.07%
Simulation client-search-params navigation loop (solid) 114.8 ms 105.4 ms +8.86%
Simulation client-head navigation loop (solid) 165.6 ms 154.3 ms +7.38%
Memory mem client preload-churn (vue) 776.2 KB 736.7 KB +5.36%
Simulation ssr control-flow unmatched 404 (react) 67.2 ms 64.2 ms +4.66%
Simulation client-nested-params navigation loop (solid) 236.9 ms 226.4 ms +4.61%
👁 Memory mem server error-paths not-found (solid) 416.3 KB 717 KB -41.93%
👁 Memory mem client navigation-churn (solid) 570.2 KB 610.3 KB -6.58%
... ... ... ... ... ...

ℹ️ 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 agent/solid-link-state-memo (1c80c35) with main (c568caf)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant