Repository navigation
perf: lower proven JSX components through compiled renderers - #619
Merged
trueadm merged 1 commit intoAug 7, 2026
Merged
Conversation
trueadm
marked this pull request as ready for review
August 7, 2026 17:58
6 of 13 tasks
6 of 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.
Summary
.tsxcomponents through their existing compiled host renderers and lightweight component slots; preserve the original callable components and inspectable JSX descriptors.defaultProps-sensitive components, and add behavioral regressions for hooks, context, live getters, descriptor escapes, spreads, refs, keys, Suspense, error boundaries, and SSR/hydration.Validation
pnpm format:checkpnpm typecheckpnpm test— 16,797 tests across 1,556 files (run withNODE_OPTIONS=--no-experimental-webstoragefor local Node 26 compatibility).node benchmarks/bench.mjs --quick --ratios signal-favoring js-framework— all 11 applicable performance-ratio guards pass.node benchmarks/bench.mjs --quick codegen-size bundle-size— the fixed code-generation corpus and normalized.tsx/.tsrxapplication/framework bundles are unchanged..tsx/.tsrxratio improves 3.46× → 1.04×; generated 100-component application output decreases 86,630 → 61,398 bytes.Risk / follow-ups
recursive-contextand global code-generation ratio ceilings already fail against checked-in upstream baselines. Recursive-context production output and all deterministic work counters are byte-for-byte unchanged; fixed code-generation and application bundles are unchanged.Provenance
agent-authored)Note
Medium Risk
Compiler-only optimization with conservative escape analysis; incorrect eligibility could change rendering or descriptor semantics, mitigated by extensive tests and unchanged paths for hooked or escaping components.
Overview
Production JSX now routes compiler-proven same-module, private, hookless components through their existing hoisted host renderers and
componentSlotLiteinstead of building descriptors and full component slots on every nested call.Eligibility is fail-closed:
collectPrivateUnescapedComponentsonly keeps module-local functions whose references never escape and that appear as attribute-free, childless JSX under an immediate host return; exported, hooked, dynamic, keyed, spread, or stored JSX still use the prior path. Fragment extraction threadsstaticFragmentRenderermetadata so call sites reuse the compiled renderer and static props while authored component functions and inspectable descriptors stay unchanged for direct calls and escapes.Benchmarks tighten
octane-jsxproduction work ceilings (e.g. shallow update: ~200→20 block renders, ~100→10 full slots, ~199→19 descriptors). Tests add nested-component fixtures and coverage for hooks, context,defaultPropsgetters, refs/keys/spreads, Suspense, error boundaries, and SSR hydration.Reviewed by Cursor Bugbot for commit b8460cb. Bugbot is set up for automated code reviews on this repo. Configure here.