Repository navigation
perf: extend returned-JSX provider region caching - #687
Merged
domgan-oai merged 1 commit intoAug 10, 2026
Merged
domgan-oai merged 1 commit into
domgan-oai merged 1 commit into
Conversation
domgan-oai
marked this pull request as ready for review
August 10, 2026 14:55
95 tasks done
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
defaultProps, unmemoized child effects, fake providers, and server-rendered DOM adoption.octanepatch changeset.Why
Merged PR #684 eliminated redundant returned-JSX wall-B reconciliation, but unchanged wall-A updates still entered their
RowsAcomponent and created avoidable wrapper descriptors. This follow-up removes that remaining work without changing authored benchmark fixtures or the public returned-JSX descriptor ABI.RowsAexecutionsPaired minified production measurements improved unchanged wall A from 0.001440 ms to 0.001032 ms (~28%) and context-only wall A from 0.620 ms to 0.582 ms (~6%); mount and changed-row timings remained stable. The affected benchmark bundle increased by 125 gzip bytes. The fixed 16-file code-generation corpus and unrelated production bundles remained byte-identical.
Changes
Validation
pnpm --config.verify-deps-before-run=false format:files:check .changeset/returned-jsx-provider-child-regions.md benchmarks/memo-wall/README.md benchmarks/memo-wall/work.mjs packages/octane/src/compiler/compile.js packages/octane/src/index.ts packages/octane/src/runtime.ts packages/octane/tests/auto-memo.test.ts./node_modules/.bin/vitest run --project octane --project octane-prod --silent=passed-only— 804 files, 11,725 tests passed.pnpm --config.verify-deps-before-run=false --config.enable-pre-post-scripts=false run typecheck— complete workspace, bindings, packages, website, examples, and benchmarks passed.pnpm --config.verify-deps-before-run=false exec vitest run packages/octane/tests/browser/suspense-hydration/suspense-hydration.test.ts --project octane-events-browser --silent=passed-only— 11 real-Chromium hydration tests passed.pnpm --config.verify-deps-before-run=false sync— generated files and agent rules remain synchronized; no additional tracked changes.Risk / follow-ups
Refs #673.
Provenance
agent-authored)Note
Medium Risk
Touches compiler auto-memo lowering and runtime reconciliation for context providers; optimization is gated conservatively but incorrect reuse could skip updates or break observable array/component semantics.
Overview
Returned-JSX provider regions can now cache and reuse a private child component that only returns a host with a keyed
props.*.map(...)list—not just the existing static host + precomputed descriptor-array shape.The compiler adds
collectPrivateMappedProviderComponents: it proves module-local returned-JSX components used solely as<Context.Provider><Rows items={items} /></Context.Provider>children, with conservative checks (no escapes, safe memo boundaries, genuine provider scope).autoMemoReturnedProviderChildemits memo slots that callcompilerCacheMappedArrayinstead of rescanning rows viacompilerCacheArray, including capture/witness dependencies for imported memo components.compilerCacheMappedArray(new runtime ABI export) reuses eligibility from the existing native-array WeakMap and declines custom maps, accessors, species, and observabledefaultPropswithout triggering new getter reads.memo-wall work gates and README now expect zero
RowsAexecutions and fewer wrappercreateElementcalls on unchanged returned-JSX wall A; extensiveauto-memotests cover context, state, keys, effects, hydration, proxies, and fake providers.Reviewed by Cursor Bugbot for commit 674e757. Bugbot is set up for automated code reviews on this repo. Configure here.