Repository navigation
perf: keep scoped JSX descriptors on fast shapes - #1013
Merged
domgan-oai merged 2 commits intoSep 9, 2026
Merged
domgan-oai merged 2 commits into
domgan-oai merged 2 commits into
Conversation
Closed
68 of 84 tasks
domgan-oai
marked this pull request as ready for review
September 9, 2026 11:53
14 of 21 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
Address the scoped JSX descriptor and props dictionary-mode finding in #981 on the client and server runtimes.
Why
A new
childrengetter per scoped element changes V8's accessor transition on later instances; overwriting the descriptor'schildren: nullfield also normalizes its shape. Complete scoped-value records create a fresh set of five getters on every instance. These descriptors occur in compiled value-position JSX, including lists with dynamic children.Changes
childrendata field and keep source/defaultchildrenreads and enumerable key order intact.cloneElement,Children.map, andChildren.toArray, including nested scoped values, custom production getters, inherited setters, and SSR.octaneand@octanejs/mcp-server.Validation
pnpm sync; no generated changes.git diff --check,tsgo --noEmit -p packages/octane/tsconfig.json, and standalone TSX fixture typecheck.node scripts/check-changesets.js && node scripts/check-release-plan.mjs; production Octane build;node benchmarks/bench.mjs --quick scoped-descriptor-shapes(48 targets).%HasFastPropertiesreports fast for four of four scoped elements, props objects, and value descriptors in both runtimes.547a369, including formatting, typecheck, Node 24 tests, React parity, browser integration, and package validation. The repository-wide commands were not separately run locally; direct scoped equivalents passed. A pnpm dependency-status preflight attempted an install through an unavailable internal registry for the final local formatter and changeset commands, so their direct equivalents were run.Risk / follow-ups
At 1,024 elements, matched-control-adjusted scoped-element enumeration is 0.09× client / 0.08× server and scoped-value enumeration is 0.18× / 0.17×. Scoped-value creation is 1.02× / 1.04× and field reads are 1.08× / 0.85×, within observed run drift; full SSR throughput is inconclusive. The benchmark measures Node property access rather than browser layout, GC pauses, or full application throughput. Exceptional prototype/setter paths preserve ordinary copy semantics and may remain dictionary-mode. The #981 issue remains open for its other findings.
Provenance
agent-authored)Note
Medium Risk
Touches core JSX descriptor creation, cloning, and SSR serialization paths used by compiler value-position JSX; behavior is heavily tested but edge cases around prototypes and accessor identity remain sensitive.
Overview
Refactors scoped element and scoped value JSX descriptors on client and server so V8 can keep fast object shapes: shared
children/ field getters backed by per-instance symbol resolvers, construction without a transientchildrendata field, andcopyScopedElementConfigso spread props,defaultProps, and rare inheritedchildrensetters still match prior observable behavior while deferring evaluation.cloneElement,Children.map, and key replacement keep each element’s deferred child resolver (including scoped values wrapping scoped elements and production custom getters) without resolving children early; SSR paths use the same rules.Adds a Node-only
scoped-descriptor-shapesbenchmark (plaincreateElementcontrols, semantic hashes, client/server in separate processes), wires it intobench.mjs, docs, and the MCP suite list, plus client/server/TSRX regressions and patch changesets foroctaneand@octanejs/mcp-server.Reviewed by Cursor Bugbot for commit 547a369. Bugbot is set up for automated code reviews on this repo. Configure here.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.