Skip to content

perf(octane): update a same-component de-opt list item without entering its render - #1664

Merged
trueadm merged 21 commits into
mainfrom
perf/memo-wall-survivor-rows
Oct 3, 2026
Merged

trueadm merged 21 commits into
mainfrom
perf/memo-wall-survivor-rows

Conversation

@trueadm

@trueadm trueadm commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Surviving rows of a value-position list no longer run their own item render just to reach their component's memo bail. This is the per-row survivor cost behind the memo-wall one_change_B ratio guard.

Builds on #1655 and #1656 (both merged), which removed the other two attributed costs of this op: per-row event-owner maps and the keyed survivor index journal.

  • The cost. A list that createElement builds (memo-wall wall B, and every @octanejs/* binding) hands back a fresh descriptor for every row on every render. Each surviving row went through updateSurvivor → renderBlock → deoptItemBody → a nested childSlot. That nested slot then re-classified the descriptor, only to land on the memo bail of the component already mounted there. Every row paid the full item render: the render-phase update loop, the signal-owner checks, warm-plan and effect-event bookkeeping, and two root-journal entries (JOURNAL_INPUTS and JOURNAL_RENDER, 8 slots).
  • The change. updateDeoptComponent takes that nested childSlot's same-component branch directly from the survivor visit. Depending on the props, that branch does one of three things: the memo bail, the identical-props implicit bail, or a journaled props update and render of the existing component Block. It runs in the item's scope (scoped descriptors resolve there, as before) and gives the item the render priority its own render would inherit. A bail leaves the item's committed descriptor in place; its props are the ones the bailed component kept.
  • What still takes the ordinary item render. Hydration, signal owners, native reads, a non-root capture, a pending or invalidated item, recorded context reads on the item, and every other child regime: component switch, host, text, list, portal, body function, implicit signal.
  • Bundle reachability. updateSurvivor is shared with compiled @for lists. Naming deoptItemBody there would pull the whole descriptor renderer into every compiled app (the fix: stop the compiled @for path retaining the descriptor renderer #767 hazard). So the function reaches it as data, ForSlot.itemUpdate, stamped in renderPreparedChildList beside plainDeopt, inside the graph that already retains it.
  • Bytes: compiled-only apps (js-framework rows, TodoMVC, chat, weather, cli-spa-starter) now grow by about +20 raw / +11 gzip. The rows app was measured locally against main; that's within the committed +32 budgets. The survivor update rides in the existing ForSlot.plainDeopt field (now the update function or null), so the compiled path pays one optional call and no new field. The first version cost +74 / +21–32. Bundles that already contain the descriptor renderer (octane-jsx, root-static, the binding scenarios) grow by about +860 raw / +250 gzip: the fast path itself, after dropping checks the component Block already implies (−100 raw / −17 gzip). Reusing updateSurvivor's existing lite branch would cost compiled apps nothing, but it journals and writes the item's inputs before its body runs, which puts back 4 journal slots and 2 calls per bailed row.

Why

Deterministic counts (jitless precise calls, the same build inputs):

base (main with #1655 and #1656) this PR
one __oneChangeB, memo-wall production build (unminified for coverage) 46,138 calls 24,138 calls
renderBlock calls in that op 1,005 5
per bailed row, new survivor-work guard: calls 48 26
per bailed row, new survivor-work guard: root-journal slots 8 0

The memo-wall work.mjs exact gates for wall B are unchanged: 1,000 survivor visits, 1,000 descriptors, 1,001 memo compares and 1/1/1 bodies for one_change_B. Its one failure, one_change_A.updateSurvivor 1 !== 1000, fails identically on the base build; that gate is stale and outside CI.

Timing: same-runner paired A/B (Bench workflow on a scratch branch with #1646's paired harness, 15 rounds, every build served at once), ms per change. The second run serves each octane build twice to measure same-build spread.

run this head base stack main (950ef0b) #639 (73b22fd) React Compiler
37118439907 0.136 0.239 0.221 0.164 0.170
37118659239 0.160 / 0.157 0.260 / 0.255 0.196

one_change_B against React (guard 1.4): this head 0.80 / 0.80 / 0.82, the base stack 1.41 / 1.33 / 1.30, main 1.30, #639 0.97. The other memo-wall ops do not reach the new code. In the second run they match the stack within same-build spread (ctx_through_wall_B 0.554 on both heads and 0.556 / 0.554 on both stacks). The first run's 0.615 vs 0.574 for that op was noise.

Changes

  • packages/octane/src/runtime.ts: updateDeoptComponent, ForSlot.itemUpdate (declared in both ForSlot literals), the stamp in renderPreparedChildList, and one optional call in updateSurvivor.
  • benchmarks/memo-wall/survivor-work.mjs (new, registered in bench.mjs): wall B's shape in happy-dom (a compiled memo row, a plain-JS createElement helper, a {rows} hole) at 128 and 256 rows with one changed row. It reports root-journal slots and jitless production-bundle calls per bailed row, with render-probe, host-identity and changed-text controls. Pass a runtime path to A/B another revision.
  • benchmarks/baselines/ratios.json: bailed_row_journal_slots (budget 0) and bailed_row_calls (budget 26) against survivor-work-budget. memo-wall one_change_B drops its waiver and tightens from 1.4 to 1.1.
  • packages/octane/tests/memo-value-position.test.ts: four behavioral cases for memo rows in a value-position keyed list (six tests). Each passes on the base runtime and with the fast path disabled; the mutation each one catches is listed below.

Validation

  • New tests, mutation-checked (each mutation applied alone; the run goes red):
    • Changed row keeps its stale props: fails "re-renders only the row whose props changed", "asks a custom comparator once per row", and the held-root case.
    • Bail via bare shallowEqualProps (no context handling): fails four, including both context-refresh cases.
    • Miss falls back to the ordinary item render: fails "asks a custom comparator once per row" (5 compares instead of 4; React calls the comparator once).
    • Item keeps a stale render priority: fails the transition-mount case (a refreshed consumer's useDeferredValue skipped the urgent deferral).
    • Two mutations stay green, as expected. Leaving CURRENT_BLOCK on the list owner only differs when scoped descriptors replay context reads under a memo ancestor. Dropping the miss path's journal entries is covered by the rollback's own invalidation of the re-rendered component. Both are kept for parity with the nested childSlot.
  • targeted tests: memo-value-position.test.ts (--project octane), 6 passed
  • pnpm typecheck:files on the changed runtime and test; pnpm format:files:check on every changed file; pnpm sync (no generated changes)
  • node benchmarks/memo-wall/survivor-work.mjs (26 / 0); with the base runtime: 48 / 8
  • pnpm test, pnpm typecheck, pnpm format:check: left to CI (many parallel local sessions)
  • Checks inherited from main:
    • example apps (3/3) / examples: signal-chat islands-budget.spec.ts failed on main itself (71,762 B gzip against 71,680). It is fixed on main by 9985bee, which raises that e2e ceiling to 71 KiB, and this branch now includes it. This PR adds 1 B to that page.
    • benchmark report: every budget breach it lists is already over budget on the base commit (for example todo_fw_raw 135,618 vs 134,272, octane-jsx fw_raw 218,605 vs 216,064). Bundles under budget on base (rows, weather, cli-spa-starter) stay under it. It stays red until ci(bench): re-set every byte budget to measured + 32 bytes #1638 resets main's budgets. All 64 js-framework work counters are unchanged.

Risk / follow-ups

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Medium Risk
Touches core list reconciliation and memo/context journaling in runtime.ts; behavior is gated by many preconditions but mistakes could affect hydration, transitions, or memo correctness.

Overview
Surviving rows in value-position keyed lists (fresh createElement descriptors per row, memo-wall wall B) no longer enter each item’s full render just to hit React.memo on the nested component. updateDeoptComponent runs from updateSurvivor for plain de-opt lists: same-component survivors get memo bail, identical-props bail, or an in-place props update + component render; everything else (hydration, signals, child-type changes, etc.) still uses the ordinary item render.

ForSlot.plainDeopt is now a nullable callback (stamped as updateDeoptComponent) instead of a boolean, keeping the descriptor renderer off compiled-only @for paths.

Benchmarks & CI: new survivor-work.mjs gates per-bailed-row root-journal slots (budget 0) and production calls (budget 26); memo-wall one_change_B vs React tightens to 1.1 and drops its performance waiver.

Tests: memo-value-position.test.ts adds coverage for one-row updates, custom comparators, context/useDeferredValue refresh under bailed rows, and suspended sibling commits.

Reviewed by Cursor Bugbot for commit 68fc0d3. Bugbot is set up for automated code reviews on this repo. Configure here.

trueadm and others added 11 commits October 3, 2026 10:33
…ak maps

#1069 made every module that can receive a signal handle record each native
handler's signal authority: the element's owner in one weak map and an
"escaped" mark for the scope in another. Keyed rows paid two weak-map
insertions per mounted row even with no signals in use. A same-runner paired
A/B put prepend100/append100/insertmid100 at 0.48 -> 0.76 ms across #1069.

The element's authority now lives in a $$signalOwner property beside its
handler slots, journaled and rolled back like before, and the escape mark is a
signalTokenEscaped field on Scope/Block with the same retirement truth table.
Mounting no longer touches a weak map.

bindSignalText also writes a scalar over the Text it already owns directly,
skipping bindDirectSignal's policy dispatch; setText still journals the text
and the binding bag. That path runs for every compiled text-hole update in
such a module (memo-wall context refresh: 0.669 -> 0.622 ms paired).

The signal-dom-bindings suite gains a deterministic guard counting weak-map
insertions per mounted and inserted handler row (2 on main, 0 now), with
dispatch and survivor-identity controls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cord

#833 made root renders undoable and journaled every keyed survivor's previous
itemIndex in updateSurvivor: four journal slots per row on each reorder,
removal, or insertion that shifts positions. A same-runner paired A/B put a
1,000-row rotate at 0.050 ms before #833 and 0.071 ms on main.

An index moves only when the list's membership or order does, which records
the list's shape (journalForSlot) anyway. reconcileKeyed now takes that
record before the first survivor index write, and restoreForSlot restores
each row's itemIndex from its chain position; a row whose index already
differed is kept exactly. The hydration adoption branch, which restores a DOM
range instead of a chain, still journals indices per row. Transition journals,
which never restored itemIndex, now restore it too.

The shape record also builds the key order with one spread and an early-exit
comparison instead of an iterator loop that copied the order element by
element.

The root-transactions suite gains reorders.mjs, which counts root-journal
slots per row for rotate/reverse/remove-first/insert-first (4 on main, 0
now). A held-root test pins that index-reading rows render their positions
after a held reorder retries; it fails when the index restore is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The stable-event-authority work observer counted authority writes through
WeakMap.prototype.set. Authority now lives in each host's $$signalOwner
property, so the observer counts writes through an Element.prototype
accessor instead. The expected counts are unchanged (400 mount, 0 retained,
0 changed capture), and dropping the runtime's unchanged-authority skip
still fails the retained-write assertion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The bench report on this PR measured +250 raw / +90 gzip bytes in every
bundle with a keyed list. journalForSlot now returns false, so the call
sites clear their pending flag without a helper. Rollback restores each
row's index from its chain position without a side map, since every
reconcile leaves a row's index equal to its position and the record is
taken before the first survivor index write. The hydration-adoption branch
does not restore a chain at all (its rows are fresh), so it no longer
journals indices per row either.

js-framework octane-tsrx bundle against main: +51 raw / +10 gzip (was
+251 / +51). The held-root index test still fails when the restore is
removed; the reorder guard still reads 0 slots per row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The hydration-adoption branch of journalForSlot restores a DOM range, not a
chain, so the trim that dropped its per-row index entries left an existing
row's itemIndex on the aborted position after a hydrating render reordered
the list and rolled back. Journal each existing row's index there again,
before reconcileKeyed moves any of them. Bundle cost against main is now
+130 raw / +31 gzip for js-framework octane-tsrx.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ng its render

A value-position list rebuilt by createElement (memo-wall wall B, every
@octanejs binding) hands back a fresh descriptor per row. Each surviving row
entered its item render (renderBlock, deoptItemBody, a nested childSlot) only
to reach the memo bail of the component already mounted there, and the root
journal recorded the item's inputs and render for every row.

updateSurvivor now hands a plain de-opt item to updateDeoptComponent, which
takes that nested childSlot's same-component branch directly, in the item's
scope and with the priority its render would inherit: the memo bail, the
identical-props bail, or a journaled props update and render of the existing
component Block. A bail leaves the item's committed descriptor in place.
Hydration, signal owners, native reads, non-root captures, unsettled items and
every other child regime keep the ordinary item render. The function reaches
updateSurvivor through ForSlot.itemUpdate, stamped in renderPreparedChildList,
so compiled @for bundles never retain the descriptor renderer.

Per bailed row (new memo-wall survivor-work guard, jitless precise calls):
48 calls and 8 root-journal slots before, 26 and 0 now. One __oneChangeB on
the memo-wall production build: 46,138 calls before, 24,138 now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent perf PR: performance work labels Oct 3, 2026
@trueadm
trueadm marked this pull request as ready for review October 3, 2026 11:06
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🟡 js-framework: 1 timed operation(s) slower beyond ±3%
  • 🔴 bundle-size: 32 value(s) increased within budget
  • 🔴 bundle-reachability: 23 value(s) increased within budget

Compares 73feb8fc7, the merge commit's first parent with 3594440a4 on the same runner. A byte value over its committed budget or any increase in a js-framework work counter fails this check. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

target operation base ms head ms head/base 95% CI
octane-tsrx select_lots 0.005 0.006 +6.9% +6.1% … +7.5% 🟡 slower
All 20 timed operations (19 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 2.767 2.775 ±0.0% −3.1% … +3.6% ⚪ within noise
octane-tsrx replace 5.933 5.608 −3.3% −11.1% … ±0.0% ⚪ within noise
octane-tsrx add 2.483 2.492 +0.0% −2.0% … +4.2% ⚪ within noise
octane-tsrx update 0.130 0.132 +0.6% −2.4% … +2.6% ⚪ within noise
octane-tsrx select 0.006 0.006 −4.3% −8.4% … −1.4% ⚪ within noise
octane-tsrx swap 0.037 0.037 +2.8% −0.9% … +4.5% ⚪ within noise
octane-tsrx remove 0.022 0.025 +9.5% +2.0% … +13.9% ⚪ within noise
octane-tsrx runlots 22.500 23.733 −1.5% −6.7% … +3.5% ⚪ within noise
octane-tsrx select_lots 0.005 0.006 +6.9% +6.1% … +7.5% 🟡 slower
octane-tsrx clear 40.817 40.825 +1.2% −1.0% … +3.5% ⚪ within noise
octane-jsx run 3.142 3.117 −1.3% −3.0% … ±0.0% ⚪ within noise
octane-jsx replace 6.333 6.058 −2.5% −7.4% … +1.6% ⚪ within noise
octane-jsx add 3.108 3.033 ±0.0% −3.0% … +3.2% ⚪ within noise
octane-jsx update 0.243 0.240 −0.7% −1.4% … +0.7% ⚪ within noise
octane-jsx select 0.127 0.128 +2.1% +1.5% … +4.7% ⚪ within noise
octane-jsx swap 0.216 0.219 +3.5% +1.2% … +5.9% ⚪ within noise
octane-jsx remove 0.161 0.164 +1.8% +0.9% … +4.0% ⚪ within noise
octane-jsx runlots 27.358 27.367 +0.7% −1.3% … +3.3% ⚪ within noise
octane-jsx select_lots 1.341 1.329 −0.3% −1.6% … +0.3% ⚪ within noise
octane-jsx clear 45.058 46.475 +3.0% +1.4% … +3.5% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 125,342 125,362 +20 (+0.0%) 🔴
octane-tsrx js_gzip 41,427 41,437 +10 (+0.0%) 🔴
octane-tsrx js_brotli 36,563 36,539 −24 (−0.1%) 🟢
octane-tsrx app_gzip 2,563 2,562 −1 (−0.0%) 🟢
octane-tsrx app_brotli 2,227 2,225 −2 (−0.1%) 🟢
octane-tsrx fw_raw 117,830 117,850 +20 (+0.0%) 🔴
octane-tsrx fw_gzip 38,864 38,875 +11 (+0.0%) 🔴
octane-tsrx fw_brotli 34,336 34,314 −22 (−0.1%) 🟢
octane-tsrx todo_js_raw 140,819 140,839 +20 (+0.0%) 🔴
octane-tsrx todo_js_gzip 46,478 46,487 +9 (+0.0%) 🔴
octane-tsrx todo_js_brotli 40,803 40,784 −19 (−0.0%) 🟢
octane-tsrx todo_app_gzip 2,477 2,476 −1 (−0.0%) 🟢
octane-tsrx todo_app_brotli 2,117 2,119 +2 (+0.1%) 🔴
octane-tsrx todo_fw_raw 135,709 135,729 +20 (+0.0%) 🔴
octane-tsrx todo_fw_gzip 44,001 44,011 +10 (+0.0%) 🔴
octane-tsrx todo_fw_brotli 38,686 38,665 −21 (−0.1%) 🟢
octane-tsrx chat_js_raw 139,939 139,959 +20 (+0.0%) 🔴
octane-tsrx chat_js_gzip 46,405 46,418 +13 (+0.0%) 🔴
octane-tsrx chat_js_brotli 40,762 40,776 +14 (+0.0%) 🔴
octane-tsrx chat_fw_raw 133,286 133,306 +20 (+0.0%) 🔴
octane-tsrx chat_fw_gzip 43,428 43,441 +13 (+0.0%) 🔴
octane-tsrx chat_fw_brotli 38,128 38,142 +14 (+0.0%) 🔴
octane-tsrx weather_js_raw 176,917 176,937 +20 (+0.0%) 🔴
octane-tsrx weather_js_gzip 57,847 57,854 +7 (+0.0%) 🔴
octane-tsrx weather_js_brotli 50,419 50,333 −86 (−0.2%) 🟢
octane-tsrx weather_app_gzip 9,035 9,034 −1 (−0.0%) 🟢
octane-tsrx weather_app_brotli 7,595 7,558 −37 (−0.5%) 🟢
octane-tsrx weather_fw_raw 150,238 150,258 +20 (+0.0%) 🔴
octane-tsrx weather_fw_gzip 48,812 48,820 +8 (+0.0%) 🔴
octane-tsrx weather_fw_brotli 42,824 42,775 −49 (−0.1%) 🟢
octane-tsrx bindings_js_raw 718,907 719,716 +809 (+0.1%) 🔴
octane-tsrx bindings_js_gzip 240,431 240,708 +277 (+0.1%) 🔴
octane-tsrx bindings_js_brotli 204,622 205,166 +544 (+0.3%) 🔴
octane-tsrx bindings_app_gzip 121,727 121,716 −11 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 101,633 101,854 +221 (+0.2%) 🔴
octane-tsrx bindings_fw_raw 362,986 363,795 +809 (+0.2%) 🔴
octane-tsrx bindings_fw_gzip 118,704 118,992 +288 (+0.2%) 🔴
octane-tsrx bindings_fw_brotli 102,989 103,312 +323 (+0.3%) 🔴
octane-jsx js_raw 227,161 227,967 +806 (+0.4%) 🔴
octane-jsx js_gzip 72,489 72,742 +253 (+0.3%) 🔴
octane-jsx js_brotli 62,815 63,092 +277 (+0.4%) 🔴
octane-jsx fw_raw 218,702 219,508 +806 (+0.4%) 🔴
octane-jsx fw_gzip 69,553 69,806 +253 (+0.4%) 🔴
octane-jsx fw_brotli 60,310 60,587 +277 (+0.5%) 🔴

10 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 115,140 115,160 +20 (+0.0%) 🔴
cli-spa-starter gzip 38,877 38,882 +5 (+0.0%) 🔴
cli-spa-starter brotli 34,015 33,979 −36 (−0.1%) 🟢
root-static raw 203,400 204,208 +808 (+0.4%) 🔴
root-static gzip 64,672 64,939 +267 (+0.4%) 🔴
root-static brotli 56,119 56,344 +225 (+0.4%) 🔴
binding-base-ui-vite raw 213,631 214,439 +808 (+0.4%) 🔴
binding-base-ui-vite gzip 68,279 68,538 +259 (+0.4%) 🔴
binding-base-ui-vite brotli 59,204 59,336 +132 (+0.2%) 🔴
binding-base-ui-esbuild raw 211,576 212,377 +801 (+0.4%) 🔴
binding-base-ui-esbuild gzip 68,210 68,450 +240 (+0.4%) 🔴
binding-base-ui-esbuild brotli 59,184 59,379 +195 (+0.3%) 🔴
binding-radix-vite raw 215,563 216,369 +806 (+0.4%) 🔴
binding-radix-vite gzip 68,807 69,091 +284 (+0.4%) 🔴
binding-radix-vite brotli 59,687 59,828 +141 (+0.2%) 🔴
binding-radix-esbuild raw 213,467 214,266 +799 (+0.4%) 🔴
binding-radix-esbuild gzip 68,797 69,055 +258 (+0.4%) 🔴
binding-radix-esbuild brotli 59,778 59,822 +44 (+0.1%) 🔴
binding-apollo-client-vite raw 358,623 359,433 +810 (+0.2%) 🔴
binding-apollo-client-vite gzip 112,365 112,603 +238 (+0.2%) 🔴
binding-apollo-client-vite brotli 98,044 98,281 +237 (+0.2%) 🔴
binding-apollo-client-esbuild raw 361,560 362,363 +803 (+0.2%) 🔴
binding-apollo-client-esbuild gzip 114,544 114,798 +254 (+0.2%) 🔴
binding-apollo-client-esbuild brotli 99,791 100,055 +264 (+0.3%) 🔴

81 other measured values are unchanged.

trueadm added a commit that referenced this pull request Oct 3, 2026
Precise coverage omits a function that ran zero times, so requiring every
control in coverage fails once surviving de-opt items skip deoptItemBody
(#1664). Check each metric's name in the production bundle source, and
require coverage hits only for the functions every ui commit calls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm and others added 3 commits October 3, 2026 12:20
…lready implies

An item whose nested slot holds a component Block never has recorded
$$ctxReads (it is neither memo nor armed) and never also holds a portal.
Its end marker and a former body-function flag do not change the
same-component branch it mirrors. A non-object item fails the kind check
without the separate null and typeof tests. -100 raw / -17 gzip in bundles
that include the descriptor renderer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1646 waived memo-wall one_change_B (octane-tsrx/react, maxRatio 1.4) until
the per-row survivor work was fixed. With same-component de-opt survivors
taking the memo bail directly, paired ~20 ms samples measured 0.80x, 0.80x
and 0.82x across two same-runner runs (the previous code: 1.30-1.41x; #639:
0.97x). 1.1 keeps about 35% headroom while catching a return of the per-row
item render.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm and others added 3 commits October 3, 2026 17:21
The plain de-opt flag now holds the list's survivor update itself
(updateDeoptComponent, or null), so ForSlot needs no second field and the
compiled @for path that shares updateSurvivor pays only one optional call.
updateDeoptComponent writes the survivor's index. The js-framework rows app
(compiled lists only) now grows +20 raw / +11 gzip over main, within the
committed +32 budget, instead of +74 / +29.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
#1664 lets a surviving value-position list row whose
descriptor names the same component take the memo bail without entering its
item render. memo-wall one_change_B goes from 1.30-1.41x to 0.80x React
Compiler (paired, same runner). Per bailed row it drops from 48 to 26
production calls and from 8 root-journal slots to 0.

The fast path itself (updateDeoptComponent) is code that bundles which already
contain the descriptor renderer now carry: about +800 raw / +210-290 gzip.
Compiled-only applications pay +20 raw / about +10 gzip for the shared call,
which fits their budgets except weather's total gzip, whose headroom had
fallen to 7 bytes.

Each budget below is set to #1664's measured bytes (PR bench run 37140101926,
on its merge commit with main d826c3e) plus 32 for raw and gzip and plus
256 for brotli, as #1638 set them. Only values #1664 exceeds change.

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
Main gained #1685, which raised 51 budgets for the useLayoutSnapshot
commit-phase priority fix (#1686), and #1681/#1665. Re-measured on main
425a32a: each of #1663, #1664 and #1666 merged alone, and all three
plus #1686 merged together. Each budget is the larger of main's value and
the largest measured value plus 32 (raw/gzip) or 256 (brotli), so the
three perf PRs and #1686 can land in any order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
…nd warm-plan perf PRs (#1687)

Three open runtime perf pull requests fail the PR bench byte gate on main
12c32ec, and landing any two of them stacks past the 32-byte headroom:

- #1664 (de-opt survivor fast path): +809 raw / +290 gzip
  in the bindings app framework chunk, which #1676 did not raise because
  #1639 added that budget key first; +20 raw in every compiled-only app.
- #1666 (warm-plan length guard): +17 raw in every client
  bundle, two `!==` guards.
- #1663 (scoped-value read-once): +2 raw / +30-70 gzip in
  descriptor-renderer bundles, a compression shift from the restructured
  childSlot reads.

Main had already spent part of the headroom: bindings framework gzip
measured exactly its budget and deferred-hydration raw had 8 bytes left.

Each budget is set to the largest value measured across each PR merged
alone with main and all of them merged together (plus #1665, which moves
none of these values), plus 32 for raw and gzip and 256 for brotli. Only
values one of those trees exceeds change.

Co-authored-by: Claude Opus 5.5 <[email protected]>
@trueadm
trueadm merged commit 1aa7696 into main Oct 3, 2026
30 checks passed
@trueadm
trueadm deleted the perf/memo-wall-survivor-rows branch October 3, 2026 20:13
trueadm added a commit that referenced this pull request Oct 3, 2026
…ion (#1663)

* perf(octane): read a deferred JSX value's fields once per classification

A component that receives JSX values as props classifies them again on
every re-render, and each field read of a deferred value runs its accessor
and resolves its record. childSlot read the type up to seven times per
value and read the key and invocation site on update paths that never use
them; de-opt list keys read each child's key three times.

Read the type once in childSlot, deoptItemBody, descNeedsBlocks,
prepareDeoptList and normalizePortalBody, read each list child's key once
through ownListKey, and read a component descriptor's key and invocation
site only when a new instance mounts. A deferred record that read no
context now returns from its resolver without inspecting the scope.

svg-dashboard's ui commits drop from 1,408 to 404 accessor calls per 16
tooltip commits and from 680 to 184 per 8 pan_zoom commits, for the same
renderBlock/childSlot/deoptItemBody visits. A new untimed work pass
(svg-dashboard/work.mjs) counts them by jitless precise coverage with
tooltip/viewport and subtree-identity controls, guarded at ratio 1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): drop the tooltip_swarm waiver now that its accessor reads are fixed

A same-runner paired A/B (run 37117916097, two passes) measured
tooltip_swarm at 0.70x React with read-once classification, against
0.78x on main and the 0.8 ceiling.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(octane): call ownListKey directly where list keys fall back to the index

The PR bench now fails on any added jitless production call. The
deoptKey and deoptKeyPositional wrappers had added an ownListKey call per
list key; their two remaining callers now call ownListKey themselves, so a
key costs one call and one field read as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): check svg-dashboard work metrics by name in the bundle

Precise coverage omits a function that ran zero times, so requiring every
control in coverage fails once surviving de-opt items skip deoptItemBody
(#1664). Check each metric's name in the production bundle source, and
require coverage hits only for the functions every ui commit calls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(octane): keep descNeedsBlocks byte-identical to main

Its optional pre-read type and local stopped esbuild from folding its
element branch into one conditional chain, which cost every js-framework,
TodoMVC, chat and weather framework chunk 21-26 raw bytes. The read-once
callers no longer need it: a host value in childSlot needs Blocks exactly
when its children do once Usable unwrapping has run, and deoptItemBody
answers a component item from its type. Those four framework chunks are
now byte-identical to main, and svg-dashboard's accessor counts stay at
404/184.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(octane): drop the resolver's dead null-reads guard on a cache hit

With the context-free fast path, a cached resolution reaches the replay
branch only when it read context, so the guard never fails. Saves 10 raw
bytes in the bindings framework chunk.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent perf PR: performance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant