perf(web): fold the SSR walker entry wrappers into the walkers - #3430
Merged
Merged
Conversation
#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 detectedLatest commit: 87fc5ff The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
Coverage Report for CI Build 34867245616Coverage remained the same at 71.842%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #3394.
What
#3394 split
tryResolveStringandresolveSSRNodeinto an entry function that resetsssrTextTailand a recursive body. The bodies are too large for V8 to inline, so every template hole paid one extra call. This passes anestedflag through the recursion instead: entry calls (no flag) reset the separator state, recursive calls keep it. One function each, identical output.server-mock.tsmirrors the signature;nestedis documented as the walker's own recursion flag — callers never pass it, and every existing call site is unchanged.Measurement
yak-bench SSR,
solid-prlane, this branch vs its base, separate-process interleaved A/B: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.jsonclean. 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