Skip to content

perf(web): fold the SSR walker entry wrappers into the walkers - #3430

Merged
ryansolid merged 1 commit into
nextfrom
perf/ssr-walker-entry
Sep 14, 2026
Merged

ryansolid merged 1 commit into
nextfrom
perf/ssr-walker-entry

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Follow-up to #3394.

What

#3394 split tryResolveString and resolveSSRNode into an entry function that resets ssrTextTail and a recursive body. The bodies are too large for V8 to inline, so every template hole paid one extra call. This passes a nested flag through the recursion instead: entry calls (no flag) reset the separator state, recursive calls keep it. One function each, identical output. server-mock.ts mirrors the signature; nested is documented as the walker's own recursion flag — callers never pass it, and every existing call site is unchanged.

Measurement

yak-bench SSR, solid-pr lane, this branch vs its base, separate-process interleaved A/B:

  • tonight, 10 alternating blocks: 1.021× geomean (medians), 1.023× paired; compose cases (hole-dense) +7–8%
  • earlier, one clean trio on a quiet machine: 1.014×

Same direction both times, but per-block spread was wide (machine busy), so read this as "recovers the ~2% #3394 cost, mechanically explained" rather than a precision figure. An in-process A/B was attempted and discarded: loading two copies of the runtime into one isolate penalises whichever loads second by ~24% regardless of which it is.

No in-repo SSR benches exist, so CodSpeed won't cover this.

Tests

Server 871 / hydrate 175 / DOM 761 pass; tsc --project tsconfig.test.json clean. No new tests — no behaviour change; the separator semantics are covered by the #3394 suites and the parity harness.

Co-authored-by: Cursor cursoragent@cursor.com

#3394 split `tryResolveString` and `resolveSSRNode` into an entry function
that resets `ssrTextTail` and a recursive body. The bodies are too big for
V8 to inline, so every template hole paid one extra call — about 2% of SSR
throughput on element-heavy pages, up to 7% where holes are dense.

Pass a `nested` flag through the recursion instead: entry calls (no flag)
reset the separator state, recursive calls keep it. One function each,
identical output. `server-mock.ts` mirrors the signature.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87fc5ff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@solidjs/web Patch
@solidjs/babel-plugin Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
test-integration Patch
@solidjs/compiler Patch
@solidjs/diagnostics Patch
@solidjs/signals Patch
solid-js Patch
@solidjs/universal Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 34867245616

Coverage remained the same at 71.842%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1007
Covered Lines: 772
Line Coverage: 76.66%
Relevant Branches: 790
Covered Branches: 519
Branch Coverage: 65.7%
Branches in Coverage %: Yes
Coverage Strength: 15.01 hits per line

💛 - Coveralls

@ryansolid
ryansolid merged commit da6ed76 into next Sep 14, 2026
6 checks passed
@codspeed

codspeed Bot commented Sep 14, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 160 untouched benchmarks


Comparing perf/ssr-walker-entry (87fc5ff) with next (5426ffb)

Open in CodSpeed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants