Repository navigation
perf(octane): bind the host descriptor renderer's entry points separately - #2255
Merged
Merged
Conversation
…tely #2249 reached the host renderer through one HOST_DESCRIPTORS object. Apps that install the renderer reach all seven of its fields, and a minifier keeps every property name in full: the object literal plus about 14 hostDriver.x reads at call sites. Make each entry point its own module binding, set together by enableHostDescriptors. HOST_BODY is set exactly when the renderer is installed, so it serves as the installed check, and callers keep the guard shapes that fold away in a bundle that never installs it. An early return keeps repeat installs from the public factories to one check, as ??= did. Against main d44d6d9: js-framework octane-jsx −99 raw / −28 gzip, descriptor-children −99 raw / −80 gzip, renderable-holes −3 raw / −5 gzip. Both reachability gates pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jonkwheeler
marked this pull request as ready for review
October 28, 2026 00:58
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | 86685e2 | Commit Preview URL Branch Preview URL |
Oct 28 2026, 11:39 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | 86685e2 | Commit Preview URL Branch Preview URL |
Oct 28 2026, 11:40 AM |
Contributor
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
65 other measured values are unchanged. Public-import reachability bundles (bytes)
110 other measured values are unchanged. |
6 of 7 tasks
Main's new HOST_DESCRIPTORS guards (#2258) now read HOST_BODY, the binding this branch sets exactly when the host renderer is installed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
A size follow-up to #2249. The host element descriptor renderer's seven entry points become separate module bindings instead of fields of one
HOST_DESCRIPTORSobject. Bundles that install the renderer reach all seven, and a minifier can shorten a binding's name but not a property's. Bundles that never install the renderer still drop it.Why
#2249 shrank
.tsrxapps that never build host descriptors by 2.4–3.7 KB gzip. It grew apps that do build them, such as JSX apps and bindings, by up to 216 gzip bytes. Its #1921 entry has no automated review: every entry since 2026-10-21 reads "No Claude review: add anANTHROPIC_API_KEYrepository secret…". So I diffed an unminifiedbenchmarks/js-framework/octane-jsxbuild at fcb0224 against one at 10b10ad. The 370 raw bytes JSX apps gained come from three places:reconcile,body,adopts,landPair,unchanged,adoptQueue,placeUpgraded) in its literal, and about 14hostDriver.xreads at call sites. A minifier keeps every property name in full.isHostDescriptor(child) ? reconcileDeoptHost(…) : reconcileDeoptNode(…)).applyDeoptTextsplit out ofapplyDeoptOrder, withqueueDeoptOrdertaking the apply function.Items 2 and 3 are what lets a bundle without host descriptors drop the renderer, so this PR leaves them alone. It changes item 1 only.
Changes
runtime/drivers.ts:HOST_BODY,HOST_RECONCILE,HOST_ADOPTS,HOST_LAND_PAIR,HOST_UNCHANGED,HOST_ADOPT_QUEUEandHOST_PLACE_UPGRADEDreplace theHostDescriptorDriverobject.enableHostDescriptorssets all seven together.HOST_BODYis set exactly when the renderer is installed, so it serves as the installed check. An early return keeps repeat installs from the public factories, which install on every call, to one check, as??=did.runtime/child-slots.ts,runtime/deopt.ts: the capturedhostDriverlocal becomeshostBody, which keeps the sameX ? X : nullshape, and calls read the bindings. Every call is guarded byhostBody !== nullor by its own binding (HOST_ADOPT_QUEUE && …), so the guards still fold away in a bundle that never installs the renderer.runtime/elements.ts: the install guards checkHOST_BODY.octane.No behavior change.
Size
From this PR's benchmark report (base d44d6d9):
octane-jsxjs −42,descriptor-children−80,full_fw−75,bindings_js−35 andsplit-shell−44. Bundles that drop it move between −14 and +13.octane-jsxjs −140,split-shell−117,hydrate-frame−99) and some grow (pagecraft_oxc+149,bindings_js+121,full_fw+109). Bundles that drop the renderer also move by up to +71 brotli on a 3-byte raw change, so part of this is compression noise. I haven't established why the larger bundles grow.So this is a consistent raw and gzip win, but not a consistent brotli one. If brotli is the number that matters here, this PR may not be worth taking.
Validation
pnpm format:check(not run;pnpm format:files:checkon the changed files is clean)pnpm typecheck(not run;pnpm typecheck:fileson the four changed runtime files is clean)pnpm test(not run; the local machine is too loaded for the full suite)auto-memo*,createelement-passthrough-children,deopt-*,descriptor-*,non-jsx-return,portal-into-deopt-host,ssr-deopt-list-identity,svg-deopt,vite-descriptor-helpers,universal-renderer, and the host and descriptor files underhydration/) pass inoctaneandoctane-prod: 80 files, 1,864 tests.HOST_ADOPTS,HOST_ADOPT_QUEUEandHOST_PLACE_UPGRADEDunset fails 18 of 114 tests in a dev and prod run ofdeopt-pure-host-upgrade,descriptor-host-capabilityandhydration/adopted-host-component-clone, mostly withTypeError: HOST_ADOPTS is not a function. Source restored afterwards.node benchmarks/bundle-size/run-minimal.mjs renderable-holes descriptor-children: both reachability gates pass. renderable-holes still drops every host renderer declaration, and descriptor-children keeps them, with both scenarios' rendered results and cleanup checked.pnpm syncleaves the tree clean.ce-code-review(lite depth, run20261027-205645-0781e77c) completed with no findings. It traced everyhostDriverandHOST_DESCRIPTORSuse to its replacement.Risk / follow-ups
enableHostDescriptorsand always together, so a setHOST_BODYimplies the rest. Each!at a call site sits under that guard.ANTHROPIC_API_KEYsecret, so no entry since then has a review.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Low Risk
Mechanical API reshaping with guarded call sites and targeted host-descriptor test coverage; no auth, data, or security surface.
Overview
Replaces the single
HOST_DESCRIPTORSdriver object with seven top-level module bindings (HOST_BODY,HOST_RECONCILE,HOST_ADOPTS,HOST_LAND_PAIR,HOST_UNCHANGED,HOST_ADOPT_QUEUE,HOST_PLACE_UPGRADED).enableHostDescriptorsassigns all of them together;HOST_BODYdoubles as the “renderer installed” guard (replacing truthy checks on the old object).Call sites in child slots, de-opt reconciliation, elements, hydration, and lists stop using
hostDriver.reconcile/.body/ etc. and invoke the bindings directly (still gated so bundles that never install the renderer can drop the code). Optional-driver bundle tests now trackHOST_BODY/hostBodyinstead ofHOST_DESCRIPTORS.No intended runtime behavior change — this is a minifier-friendly size follow-up (patch changeset for
octane).Reviewed by Cursor Bugbot for commit 86685e2. Bugbot is set up for automated code reviews on this repo. Configure here.