Repository navigation
perf: reuse nested implicit SSR descriptor key prefixes - #1035
Merged
domgan-oai merged 1 commit intoSep 10, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
September 10, 2026 16:20
Closed
68 of 84 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.
Summary
Continues #981 after #1034; the combined list-key item remains open.
Performance evidence
Compared with merged main
afdc3618aon Node 26.4.0 / Apple M5 Max, using frozen minified production bundles:Self-review caught a 17.1% flat-list slowdown in the initial larger-helper design. Restoring the original flat/singleton helper removed the separated control distributions. Final rebuilt artifact matches the measured SHA. Full numbers and reproduction commands are in
benchmarks/ssr-throughput/README.md.Validation
Current-head CI: 26/26 jobs passed at
cfc786198fd14d64bdb970deaa36930e673d16d4. Cursor Bugbot completed successfully with no findings; there are no unresolved review threads. The PR contains live mainafdc3618aand has no merge conflicts.Targeted dev/prod SSR, streaming, async retries, descriptor identity, and hydration tests: 28 files / 550 tests passed.
Deliberate wrapper-path removal made the new reorder case fail in both modes with another wrapper's settled value; restored implementation passed.
tsrx-tsc --noEmit -p packages/octane/tsconfig.jsonScoped Prettier checks,
git diff --check, changeset/release-plan checks, andpnpm syncFinal minified nested work/HTML/CSS gate; existing
unkeyed-work.mjsgateFinal rebuilt benchmark artifact equals the timed artifact.
pnpm format:check(scoped checks run locally)pnpm typecheck(core program checked locally)pnpm test(targeted core suites run locally; repository coverage runs in CI)Risk / follow-ups
Nested leaf key strings still exist; this removes repeated wrapper-path serialization. Explicit coercion, the per-list key callback, and other #981 items remain open. The local prefix adds a small bundle cost; timing does not establish a throughput gain. No state is retained across retries, requests, or aborts.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes SSR child-list identity key generation used by Suspense retries and hydration; behavior is heavily tested but mistakes could mis-associate async row results.
Overview
Server rendering now reuses one serialized wrapper-path prefix for siblings inside nested implicit descriptor lists, appending each position index instead of calling
JSON.stringifyon the full[path,"index",i]tuple every time. Flat top-level lists and single-child containers still use the originalscopedSsrDeoptKeyfast path so common cases are not slowed down.The optimization is scoped to a synchronous
flattenSsrChildContainerwalk: prefix state does not carry across retries, explicit keys still use the full tuple encoding, and patchedJSON.stringify/ exotic paths fall back to the prior behavior so identity bytes stay compatible with hydration and async Suspense retries.Adds SSR regressions for nested sibling ordering under interleaved retries and out-of-order streaming, plus an opt-in
nested-work.mjsproduction gate (nested vs flat vs fully explicit controls) and benchmark notes documenting reduced JSON work without claiming throughput wins.Reviewed by Cursor Bugbot for commit cfc7861. Bugbot is set up for automated code reviews on this repo. Configure here.