Repository navigation
Description
Summary
Octane ships two renderers. Compiled templates run on Block/slot instructions with compiler-specialized setters. Alongside them sits a generic descriptor renderer, about 50 kB raw / 15 kB gzip in the shell_ app from #2027. It has its own child dispatcher, list reconcilers, host reconciler, component path and generic prop tables. Every real app ships both, and this second renderer is the whole reason Octane's core is larger than React's.
Measured on the shell_ app (oxc minify; sourcemap attribution per declaration; gzip figures are the marginal saving from deleting each group's bytes and re-gzipping). The React reference here is react-dom 19.2.8:
| Area | Octane | React 19.2.8 |
|---|---|---|
| Render/reconcile: blocks, component slot, templates, control flow, keyed lists, generic children vs beginWork, child reconciler, completeWork, commit | 71.1k / 21.7k | 46.3k / 12.6k |
| DOM props / attrs / style | 14.1k / 4.7k | 16.8k / 5.1k |
| Events | 12.5k / 4.3k | 20.6k / 6.9k |
| Controlled inputs + focus/selection | 16.1k / 4.7k | 6.5k / 2.2k |
Hooks, effects, refs (React also counts the react package) |
15.8k / 4.9k | 21.9k / 6.5k |
| Core total (raw / gzip) | ~145k / ~45k | ~113k / ~33.5k |
All of the ~11 kB gzip excess is in render/reconcile. Without the generic renderer the compiled-template core is about 30 kB gzip, below React's.
The second renderer
Generic descriptor renderer, shell_ app |
raw / gzip |
|---|---|
childSlot dispatcher (+ renderReturnedValue, childTextHole, clearChildContent) |
17.8k / 5.0k |
Block-backed deopt lists/items (renderPreparedChildList, deoptItemBody, updateDeoptComponent, mappedDeoptItemBody) |
11.2k / 3.3k |
Raw-DOM host reconciler (reconcileDeoptNode/reconcileDeoptChildren, applyDeoptProps/patchDeoptProps, removeHostProp) |
6.3k / 2.2k |
Block-backed host (hostElementBody, hostStringTagBody) |
2.3k / 0.7k |
Generic setAttribute + ATTRIBUTE_ALIASES / SVG_ONLY_TAGS / style tables |
8.7k / 2.8k |
Descriptor API (createScopedElement etc.) |
3.8k / 1.0k |
| Total | ~50k / ~15k |
It duplicates the compiled path three times over:
- Three list reconcilers:
reconcileKeyed(LIS, used by@forand deopt arrays),reconcileDeoptChildren(a raw-DOM keyed diff), andmountItemsLinear/mountPassthroughListItem. - Two element/prop paths: compiled templates use
cloneplus compiler-specialized setters (compiled-only bundles have nosetAttributeor alias tables). Descriptors useapplyDeoptProps/patchDeoptProps/removeHostPropplus genericsetAttribute. - Two component paths:
componentSlotImplvsupdateDeoptComponent/deoptItemBody.
The lite/void/strong component tiers are not a size problem (0.5–1.8k raw each).
Every real app reaches it
.tsx: areturn <jsx>body is value position and is lowered tocreateElementdescriptors by design (thecompile.jsSSR comment explains that the server matches this so block counts agree). Only hookless single-root components get templates..tsrx: any renderable hole,{children}, a component not proven to return a compiled template,lazy, dynamic tags andViewTransitionall reachchildSlot. The edges arecomponentSlot → renderReturnedValue → childSlot,componentSlot → hostStringTagBody → childSlotandViewTransition → initializeViewTransitionComponent → childSlot.
| App (framework gzip) | .tsx |
.tsrx |
|---|---|---|
base, {String(count)} |
58.0k | 29.5k |
base, bare {count} |
— | 56.9k |
rich (@for, @if, controlled input, dynamic attributes) |
58.1k | 39.6k |
rich + one {props.children} |
— | 59.4k (+19.8k) |
full shell_ app |
124.3k | 122.7k |
The render(<App/>) entry is not the cause: it costs +53 B gzip over render(App).
Target design
- Descriptors are input to the same Block/slot instructions as templates. One generic host-element instruction serves descriptors and dynamic tags, so there is no separate raw-DOM host reconciler.
reconcileKeyedis the only list reconciler. Descriptor arrays,@forand passthrough lists all use it.- One prop path. The compiled setters plus one generic
setPropfor spreads and descriptors. The alias and SVG tables stay only on the generic path. - One component path.
componentSlotImpl;updateDeoptComponent/deoptItemBodygo away. childSlotbecomes a thin dispatcher: text, array, component, null..tsxreturn <jsx>compiles to templates. When the returned JSX is the component's output (not stored or passed around as a value), emit the same template code.tsrxgets. Server and client must change together, because the hydration cursor depends on matching block counts.
Estimated −7 to −10 kB gzip in the shell_ app, keeping about 5 of the 15 kB, which puts the core at or below React's. Separately, .tsx apps whose components can be compiled to templates also stop paying for descriptors in their own output.
Plan
Each step lands with its own measurement and the differential, conformance and hydration suites green:
- Measure. Add a
.tsrxtwin of theshell_app and a.tsx"rich" app to the bundle-size report (reported only, no budget). - One list reconciler. Descriptor arrays use
reconcileKeyed; deletereconcileDeoptChildren's keyed diff. Benchmark large component-free descriptor trees, since this is the raw-DOM path's reason to exist. - One prop path. Descriptor host props go through the compiled setters plus one
setProp. - One component path. Fold
updateDeoptComponent/deoptItemBodyintocomponentSlotImpl. - Thin
childSlot. Move portal, signal, thenable, context and off-screen branches behind drivers that their creators install. - Compile
.tsxreturn <jsx>to templates, keeping the server and the hydration cursor in step.
Must keep
- React element semantics:
createElement/cloneElement/Children/isValidElement, keys, element identity, descriptors as first-class values. - Keyed reconciler guarantees: final DOM and survivor identity (LIS-based; the set of moved nodes is not guaranteed).
- Hydration of descriptor ranges, coordinated with Hydration: collapse the hydration engine back into the mount path (Ripple/Svelte-style cursor), 23 kB → ~5 kB gzip #2028's single marker protocol.
- HMR and dev diagnostics.
- Performance: js-framework rows, TodoMVC and the update benches must not regress. Large component-free descriptor trees are the case to watch.
Open questions
- Does the raw-DOM deopt reconciler's speed on large component-free trees justify keeping a specialized path, or does
reconcileKeyedwith one generic host instruction match it? - Should the compiler warn or document when
.tsxJSX stays on the descriptor path, so authors can see the cost?
Related: #2027 (benchmark), #2028 (hydration), #2029 (commit model), #1801 (size umbrella).
🤖 Generated with Claude Code
Activity
trueadm commentedon Oct 13, 2026
Superseded by #2043, which covers the one-renderer work as part of a single compiled commit model.