Skip to content

perf(octane): keep the transition and hidden-Activity graphs out of Suspense-only bundles - #1855

Merged
trueadm merged 1 commit into
mainfrom
perf/suspense-capability-split
Oct 7, 2026
Merged

trueadm merged 1 commit into
mainfrom
perf/suspense-capability-split

Conversation

@trueadm

@trueadm trueadm commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a hydrate-frame bundle-reachability scenario shaped like a production signals + hydration app: a server-rendered frame hydrated with native signal reads, a keyed @for, a @try/@pending/@catch boundary, forwarded style objects, a portal opened after hydration, and an octane/behavior island. It reproduces the audited runtime chunk closely (main: 374,640 B raw / 115,527 B gzip; the audited chunk was 391 KB / 121 KB).
  • Splits two optional capabilities that every Suspense application paid for:
    • Transition root driver. A @try with a @pending arm installed the whole transition driver (attempts, root holds, held-update replay, urgent transition renders). It now installs only the off-screen swap it uses for urgent branch replacement. startTransition installs the transition members, as it already must before any transition-priority work exists.
    • Hidden-Activity visibility. The Suspense visibility driver carried <Activity>'s re-hide and hidden re-render. activityBlock now installs them when it first hides an Activity, the only way a Suspense boundary can find a hidden one.
    • Drops the swap driver's commit member, which nothing called.
  • hydrate-frame: −9,790 B raw / −2,704 B gzip (−2.6% / −2.3%). A Suspense app without transitions (deferred-hydration): −9,979 B raw / −2,776 B gzip. No behavior change.

Breakdown: what the client runtime ships for this app shape (main)

Measured on hydrate-frame at main 7e6bda5 with the bundle-size harness's Vite/Oxc production build plus source maps. Coverage is V8 precise block coverage in jsdom from script evaluation through hydration, the first signal write, opening the portal and an island click. 374,696 B raw / 115,577 B gzip, 29.7% of bytes executed.

By module

Module Minified bytes Share Executed Never executed
runtime.ts 280,885 75% 25% 210,813
signals/graph.ts 14,385 4% 34% 9,552
behavior-root.ts 12,789 3% 48% 6,679
signals/engine.ts 11,445 3% 36% 7,278
signals/computations.ts 7,577 2% 11% 6,768
signals/native-read-client.ts 4,663 1% 67% 1,518
signals/facade.ts 4,654 1% 41% 2,761
dom-tables.js 4,368 1% 96% 182
fixture: hydrate-frame-app.tsrx 3,892 1% 77% 910
signals/native-read-seeds.ts 3,305 1% 26% 2,435
data-encoding.ts 2,715 1% 35% 1,754
alien-signals/esm/system.mjs 1,852 0% 55% 832
signals/early-values.ts 1,652 0% 29% 1,167
hook-slot-cache.ts 1,623 0% 14% 1,401
signals/read-protocol.ts 1,405 0% 73% 385
signals/native-read-collector.ts 1,402 0% 60% 559
fixture: hydrate-frame.ts 1,388 0% 100% 0
signals/redeclaration.ts 1,296 0% 11% 1,155
style-values.js 1,294 0% 69% 405
signals/candidate-producers.ts 1,198 0% 2% 1,170
stream-protocol.ts 1,139 0% 4% 1,093
event-names.js 1,024 0% 88% 126
(33 smaller modules) 8,745 2% 50% 4,352

By capability

Area Minified bytes Never executed Executed Largest cold declarations
signals engine (octane/signals) 60,989 38,964 36% promoteDeclarationView 1,534, createNativeReadDriver 1,518, getInitialDocumentCapture 1,313
hydration: adopt/claim core 40,004 27,921 30% hydrateRootWithOutputHandler 2,391, coalesceHydratedRanges 1,901, HydrationCapability.adopt 1,030
root / render core 39,133 24,520 37% renderBranchSlot 4,003, componentSlotImpl 3,984, makeRoot 2,508
Suspense / @try / Activity / off-screen 33,397 29,149 13% mountTry 2,512, switchToCatchInner 1,841, attemptHiddenRevealInner 1,791
generic child / descriptor / de-opt 31,673 26,878 15% childSlot 8,329, renderPreparedChildList 3,398, deoptItemBody 2,659
runtime: other 26,737 17,747 34% clearChildContent 1,598, childTextHole 1,229, bindingText 638
transitions + journal 19,577 16,980 13% endTransitionAttempt 964, rollbackTransitionJournal 912, holdRootTransition 793
refs / effects / scheduler 18,290 13,946 24% drainQueue 1,136, detachSubtreeRefs 1,032, batchClearItems 828
controlled forms / DOM props 14,091 12,183 14% setAttribute 1,377, restoreForSlot 1,295, maybeEnqueueRestore 1,068
keyed list / @for 13,256 10,949 17% reconcileKeyed 3,919, forBlock 1,485, deferRootOwnedListClear 1,049
behavior root (octane/behavior) 12,789 6,679 48% registerExternalRange 1,246, registerBehavior 799, handleDelegatedEvent 578
signal bindings (renderer side) 10,664 6,617 38% bindSignalChild 908, bindDirectSignal 852, createDirectSignalBinding 555
hydration: stream / adoption / seeds 10,048 7,361 27% parseSeedJson 844, isBindingOpenComment 651, HydrationCapability.seedOrCreate 457
events 7,933 3,577 55% dispatchDelegatedCapture 555, buildDelegatedPath 368, delegateCaptureEvents 296
DOM tables (attribute aliases, SVG tags, style, events) 7,707 1,129 85% (module evaluation) ATTRIBUTE_ALIASES 2,977 and SVG_ONLY_TAGS 743 execute at load
focus / selection preservation 5,304 4,981 6% moveFocusedNodeBefore 951, captureFocusSelection 916, restoreFocusSelection 727
portal 4,682 2,689 43% resolvePortalEventOwner 561, renderPortalState 555
hydration mismatch recovery / diagnostics 4,367 4,206 4% decodeHydrationRejectionPayload 748, fallBackServerCatch 401, describeHydrationNode 320
context / hooks / state 3,417 2,417 29% readStateHook 833, readContextFrom 543
error formatter 395 336 15% formatProdErrorMessage 237

Areas group runtime.ts declarations by name, so the split is approximate; module totals above are exact.

Findings

Coverage counts code that ran before the page was interactive, not code the app can never need: Suspense fallbacks, keyed moves and mismatch recovery must stay synchronous when they do run, so they cannot move behind a dynamic import without changing behavior. The lever is reachability: code that ships only because an unrelated feature retains it.

Moved behind their owning capability in this PR

  • Transition root members (attempts, root holds, held-update replay, urgent transition renders): retained by every @try+@pending through the shared swap driver. Now installed by startTransition only. Transitions + journal on hydrate-frame: 19,577 → 12,370 minified bytes.
  • Hidden-Activity re-render and re-hide: retained through the Suspense visibility driver. Now installed by activityBlock when it first hides an Activity. Suspense/Activity area: 33,397 → 31,321.
  • The swap driver's commit member had no caller.

Found, not in this PR

  • Published error formatter duplication. The publish build (specialize-error-calls.mjs) inlines a private __octaneNoArgError helper, with the full "Minified Octane error" text, into each of 29 zero-argument modules. hydrate-frame built against the published dist/ carries 9 copies (+1,562 B raw / +196 B gzip over source), and a code-split app carries one per chunk. perf(octane): share one production formatter across published zero-argument errors #1856 makes the specializer import one shared formatter instead: 22 copies in 10 chunks become 2 copies in one chunk for a split build of this app.
  • Generic child path under native reads (31.7 KB, 85% cold). {createPortal(...)} compiles to a direct portal() call, except in a module with a signals import, where it becomes bindSignalChild and retains childSlot with the descriptor/de-opt renderer. Apps with {children} holes retain childSlot anyway, so this matters only for apps whose sole generic hole is a portal.
  • HydrationCapability (23.9 KB, 77% cold). Its methods cannot tree-shake individually, but only about 1.6 KB of them have no live caller in this shape, so splitting the class is not worth it here.
  • SVG and attribute-alias tables (3.7 KB). They are retained by the generic attribute writer and descriptor namespace inference. React applies the aliases on every element, so they cannot be keyed by namespace without changing output. They run at module evaluation, so building them lazily would cut startup work but not bytes.
  • Hydration mismatch diagnostics (4.4 KB, 96% cold). Production still creates the describeHydrationNode thunks it passes to mismatch(), which only development reads. About 0.4 KB.
  • octane/behavior (12.8 KB, 52% cold). registerExternalRange and the other root methods ship whenever attachBehaviorRoot is used, and its errors are plain English strings in production rather than catalog codes.
  • Stream adoption. stream-protocol.ts (1.1 KB, 4% executed) and the seed parser ship with every hydrating root, but this shape does not stream.
  • Signals engine (61 KB, 64% cold) is owned by perf(signals): install the public Scope surface only from createScope #1851 and its follow-ups. Focus preservation (5.3 KB, 94% cold) is reachable from any keyed move and cannot be gated soundly.

Bundle-size gate

Both runners, on this head, with --write-budgets (every scenario and app; values only lowered, plus the new hydrate-frame key). node benchmarks/bundle-size/budget-raises.mjs --base origin/main reports no raised budget.

node benchmarks/bundle-size/run-minimal.mjs --write-budgets (exit 0; main measured from the same harness on 7e6bda5):

Scenario main raw / gzip head raw / gzip Δ raw / gzip
hydrate-frame (new) 374,640 / 115,527 364,850 / 112,823 −9,790 / −2,704
deferred-hydration 230,935 / 72,354 220,956 / 69,578 −9,979 / −2,776
suspense-transition (uses startTransition) 141,697 / 44,567 138,918 / 43,838 −2,779 / −729
hydrate-root 137,671 / 44,037 137,671 / 44,037 0 / 0
hooks-state 84,021 / 27,645 84,021 / 27,645 0 / 0
root-static 165,046 / 52,096 165,054 / 52,090 +8 / −6

binding-base-ui, binding-radix and binding-apollo-client (Vite and esbuild) budgets drop 22–26 B raw.

node benchmarks/bundle-size/run.mjs --write-budgets octane-tsrx octane-jsx (exit 0), framework bytes:

App main raw / gzip head raw / gzip Δ raw / gzip
rows 105,794 / 34,396 105,794 / 34,396 0 / 0
todo 116,520 / 37,297 116,529 / 37,312 +9 / +15
chat 114,122 / 36,648 114,131 / 36,656 +9 / +8
weather 134,288 / 42,873 134,298 / 42,877 +10 / +4
bindings 338,475 / 108,408 338,452 / 108,418 −23 / +10

todo, chat and weather use neither Suspense nor transitions. They gain one more never-assigned driver slot (9–10 B raw), within the 32 B ratchet, so their budgets are unchanged.

Validation

  • node benchmarks/bundle-size/run-minimal.mjs --write-budgets and node benchmarks/bundle-size/run.mjs --write-budgets octane-tsrx octane-jsx: both exit 0. Every reachability fixture, hydrate-frame included, runs its production bytes in jsdom against its oracle.
  • ./node_modules/.bin/vitest run --project octane on the 25 transition, Suspense, Activity, action and @try files: 438 passed.
  • Mutation checks. Without the Activity members installed, activity.test.ts and activity-suspense-retry.test.ts fail 9 tests (once for rehide, once for retryActivity). Without the root driver installed, transitions.test.ts and transition-held-audit.test.ts fail 26 tests.
  • pnpm typecheck:files packages/octane/src/runtime.ts, pnpm format:files:check on changed files, pnpm sync (clean).
  • pnpm test, pnpm typecheck and pnpm format:check were not run locally; CI runs them.

Risk / follow-ups

  • The invariant "transition-priority work only exists after runTransition" now also guards Suspense-only apps. The existing comment already made it load-bearing for apps with neither feature. Every pendingMode = 'transition' writer was checked, including useDeferredValue, which goes through startTransition.
  • Apps that install the off-screen swap first and start a transition later (the common order in the transition tests) end up with both drivers.
  • Two sibling sessions are changing hydration paths in runtime.ts. Any overlap is a few call-site lines.
  • hydrate-frame hydrates server markup from a production server build of the same modules, so a marker-protocol change updates both sides together. A hydration mismatch fails its adopted oracle.

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
Changes when core transition and Activity code is linked into production bundles and touches many runtime commit/render paths, though behavior is intended to be unchanged and is guarded by reachability oracles and targeted tests.

Overview
Splits optional runtime drivers so Suspense-only apps no longer ship transition root logic (attempts, holds, held-update replay) or hidden-<Activity> re-hide/re-render. A @try boundary with @pending now installs only the off-screen swap used for urgent branch replacement; startTransition installs the transition root driver; <Activity> installs Activity visibility hooks on first hide. The unused swap-driver commit path is removed. Runtime call sites move from a single TRANSITION_SWAP_DRIVER to TRANSITION_SWAP_DRIVER (swap) vs TRANSITION_ROOT_DRIVER (transitions).

Adds a hydrate-frame bundle-reachability scenario (server renderToString + client hydrate) covering signals, keyed @for, settled @try, styles, portal, and octane/behavior, with adoption oracles and byte budgets. Harness support builds optional *.server.ts markup for hydrating scenarios. Committed budgets drop for Suspense-heavy fixtures (e.g. ~9.7 KB raw / ~2.7 KB gzip on deferred-hydration and the new frame shape) with no intended behavior change.

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

…uspense-only bundles

A @Try boundary with a @pending arm installed the whole transition swap
driver, so every Suspense application retained transition attempts, root
holds, held-update replay and urgent transition renders, and the Suspense
visibility driver retained <Activity>'s hidden re-render and re-hide.

- Split the driver: tryBlock installs only the off-screen swap (render,
  dispose, splice). startTransition, the one entry to transition-priority
  work, also installs TRANSITION_ROOT_DRIVER. A missing root driver reports
  what an installed one reports before any transition: no attempt, no root
  hold, no held update.
- activityBlock installs the Activity members of the visibility driver
  before it first hides an Activity; a Suspense boundary reaches them only
  through a hidden Activity it found.
- Drop the swap driver's never-called commit member.

Adds the hydrate-frame bundle-reachability scenario: a production server
build renders the markup, and the measured client bundle hydrates a frame
with native signal reads, a keyed @for, a @Try boundary, forwarded styles,
a portal and an octane/behavior island.

hydrate-frame 374,640 -> 364,850 raw, 115,527 -> 112,823 gzip;
deferred-hydration 230,935 -> 220,956 raw, 72,354 -> 69,578 gzip.
Budgets lowered with --write-budgets; none raised.

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

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website 4836ec0 Commit Preview URL

Branch Preview URL
Oct 07 2026, 07:25 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website-mcp 4836ec0 Commit Preview URL

Branch Preview URL
Oct 07 2026, 07:26 PM

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 36 value(s) increased within budget
  • 🔴 bundle-reachability: 11 value(s) increased within budget

Compares 7e6bda5ec, the merge commit's first parent with daa0445ee 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

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 4.075 4.642 −0.9% −11.1% … +9.7% ⚪ within noise
octane-tsrx replace 15.792 14.550 +4.9% −5.6% … +11.7% ⚪ within noise
octane-tsrx add 3.483 3.767 +6.3% −5.6% … +16.9% ⚪ within noise
octane-tsrx update 0.180 0.194 +2.0% −4.1% … +7.8% ⚪ within noise
octane-tsrx select 0.007 0.006 −3.6% −10.7% … +0.3% ⚪ within noise
octane-tsrx swap 0.045 0.046 +3.8% +0.7% … +6.5% ⚪ within noise
octane-tsrx remove 0.023 0.023 +2.9% −8.1% … +12.8% ⚪ within noise
octane-tsrx runlots 29.142 30.425 +4.8% −2.6% … +12.3% ⚪ within noise
octane-tsrx select_lots 0.008 0.008 −2.5% −10.0% … +3.5% ⚪ within noise
octane-tsrx clear 62.242 59.850 +1.6% −1.9% … +13.4% ⚪ within noise
octane-jsx run 4.117 4.233 +4.7% −4.1% … +10.4% ⚪ within noise
octane-jsx replace 10.425 10.308 +2.4% −5.5% … +7.2% ⚪ within noise
octane-jsx add 3.542 3.425 −5.6% −8.0% … +1.3% ⚪ within noise
octane-jsx update 0.340 0.318 +1.4% −6.5% … +7.0% ⚪ within noise
octane-jsx select 0.152 0.151 −2.5% −5.1% … +2.4% ⚪ within noise
octane-jsx swap 0.290 0.299 +2.7% −3.2% … +13.4% ⚪ within noise
octane-jsx remove 0.245 0.227 +8.2% −0.6% … +18.3% ⚪ within noise
octane-jsx runlots 40.517 37.517 −1.5% −6.1% … +12.4% ⚪ within noise
octane-jsx select_lots 2.729 2.419 −7.4% −14.0% … −1.0% ⚪ within noise
octane-jsx clear 76.667 70.925 −5.4% −12.3% … +7.6% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx todo_js_raw 121,138 121,147 +9 (+0.0%) 🔴
octane-tsrx todo_js_gzip 39,518 39,532 +14 (+0.0%) 🔴
octane-tsrx todo_js_brotli 34,781 34,788 +7 (+0.0%) 🔴
octane-tsrx todo_app_gzip 2,221 2,220 −1 (−0.0%) 🟢
octane-tsrx todo_app_brotli 1,881 1,892 +11 (+0.6%) 🔴
octane-tsrx todo_fw_raw 116,520 116,529 +9 (+0.0%) 🔴
octane-tsrx todo_fw_gzip 37,297 37,312 +15 (+0.0%) 🔴
octane-tsrx todo_fw_brotli 32,900 32,896 −4 (−0.0%) 🟢
octane-tsrx chat_js_raw 119,887 119,896 +9 (+0.0%) 🔴
octane-tsrx chat_js_gzip 39,363 39,372 +9 (+0.0%) 🔴
octane-tsrx chat_js_brotli 34,704 34,710 +6 (+0.0%) 🔴
octane-tsrx chat_app_gzip 2,715 2,716 +1 (+0.0%) 🔴
octane-tsrx chat_app_brotli 2,388 2,384 −4 (−0.2%) 🟢
octane-tsrx chat_fw_raw 114,122 114,131 +9 (+0.0%) 🔴
octane-tsrx chat_fw_gzip 36,648 36,656 +8 (+0.0%) 🔴
octane-tsrx chat_fw_brotli 32,316 32,326 +10 (+0.0%) 🔴
octane-tsrx weather_js_raw 156,442 156,452 +10 (+0.0%) 🔴
octane-tsrx weather_js_gzip 50,745 50,748 +3 (+0.0%) 🔴
octane-tsrx weather_js_brotli 44,265 44,235 −30 (−0.1%) 🟢
octane-tsrx weather_app_gzip 7,872 7,871 −1 (−0.0%) 🟢
octane-tsrx weather_app_brotli 6,649 6,672 +23 (+0.3%) 🔴
octane-tsrx weather_fw_raw 134,288 134,298 +10 (+0.0%) 🔴
octane-tsrx weather_fw_gzip 42,873 42,877 +4 (+0.0%) 🔴
octane-tsrx weather_fw_brotli 37,616 37,563 −53 (−0.1%) 🟢
octane-tsrx bindings_js_raw 686,125 686,102 −23 (−0.0%) 🟢
octane-tsrx bindings_js_gzip 224,080 224,089 +9 (+0.0%) 🔴
octane-tsrx bindings_js_brotli 190,437 190,562 +125 (+0.1%) 🔴
octane-tsrx bindings_app_gzip 115,672 115,671 −1 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 96,206 96,253 +47 (+0.0%) 🔴
octane-tsrx bindings_fw_raw 338,475 338,452 −23 (−0.0%) 🟢
octane-tsrx bindings_fw_gzip 108,408 108,418 +10 (+0.0%) 🔴
octane-tsrx bindings_fw_brotli 94,231 94,309 +78 (+0.1%) 🔴
octane-tsrx full_fw_raw 564,262 564,365 +103 (+0.0%) 🔴
octane-tsrx full_fw_gzip 169,685 169,731 +46 (+0.0%) 🔴
octane-tsrx full_fw_brotli 142,780 142,856 +76 (+0.1%) 🔴
octane-jsx js_raw 187,227 187,238 +11 (+0.0%) 🔴
octane-jsx js_gzip 59,289 59,295 +6 (+0.0%) 🔴
octane-jsx js_brotli 51,633 51,652 +19 (+0.0%) 🔴
octane-jsx app_gzip 2,858 2,857 −1 (−0.0%) 🟢
octane-jsx app_brotli 2,410 2,414 +4 (+0.2%) 🔴
octane-jsx fw_raw 178,962 178,973 +11 (+0.0%) 🔴
octane-jsx fw_gzip 56,431 56,438 +7 (+0.0%) 🔴
octane-jsx fw_brotli 49,223 49,238 +15 (+0.0%) 🔴
octane-jsx full_fw_raw 564,262 564,365 +103 (+0.0%) 🔴
octane-jsx full_fw_gzip 169,685 169,731 +46 (+0.0%) 🔴
octane-jsx full_fw_brotli 142,780 142,856 +76 (+0.1%) 🔴

14 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
root-static raw 165,046 165,054 +8 (+0.0%) 🔴
root-static gzip 52,096 52,090 −6 (−0.0%) 🟢
root-static brotli 45,346 45,323 −23 (−0.1%) 🟢
context raw 96,219 96,228 +9 (+0.0%) 🔴
context gzip 31,330 31,341 +11 (+0.0%) 🔴
context brotli 27,833 27,827 −6 (−0.0%) 🟢
deferred-hydration raw 230,935 220,956 −9,979 (−4.3%) 🟢
deferred-hydration gzip 72,354 69,578 −2,776 (−3.8%) 🟢
deferred-hydration brotli 62,332 59,927 −2,405 (−3.9%) 🟢
hydrate-frame raw – 364,850 – 🆕
hydrate-frame gzip – 112,823 – 🆕
hydrate-frame brotli – 96,469 – 🆕
suspense-transition raw 141,697 138,918 −2,779 (−2.0%) 🟢
suspense-transition gzip 44,567 43,838 −729 (−1.6%) 🟢
suspense-transition brotli 39,181 38,546 −635 (−1.6%) 🟢
binding-base-ui-vite raw 197,045 197,019 −26 (−0.0%) 🟢
binding-base-ui-vite gzip 61,907 61,891 −16 (−0.0%) 🟢
binding-base-ui-vite brotli 53,864 53,777 −87 (−0.2%) 🟢
binding-base-ui-esbuild raw 212,539 212,517 −22 (−0.0%) 🟢
binding-base-ui-esbuild gzip 68,838 68,836 −2 (−0.0%) 🟢
binding-radix-vite raw 199,075 199,049 −26 (−0.0%) 🟢
binding-radix-vite gzip 62,491 62,486 −5 (−0.0%) 🟢
binding-radix-vite brotli 54,333 54,367 +34 (+0.1%) 🔴
binding-radix-esbuild raw 214,364 214,342 −22 (−0.0%) 🟢
binding-radix-esbuild gzip 69,413 69,408 −5 (−0.0%) 🟢
binding-radix-esbuild brotli 60,194 60,213 +19 (+0.0%) 🔴
binding-mantine-hooks-esbuild raw 90,436 90,440 +4 (+0.0%) 🔴
binding-mantine-hooks-esbuild gzip 30,350 30,351 +1 (+0.0%) 🔴
binding-mantine-hooks-esbuild brotli 27,095 27,030 −65 (−0.2%) 🟢
binding-apollo-client-vite raw 339,489 339,463 −26 (−0.0%) 🟢
binding-apollo-client-vite gzip 104,213 104,205 −8 (−0.0%) 🟢
binding-apollo-client-vite brotli 90,931 91,018 +87 (+0.1%) 🔴
binding-apollo-client-esbuild raw 362,677 362,655 −22 (−0.0%) 🟢
binding-apollo-client-esbuild gzip 115,187 115,185 −2 (−0.0%) 🟢
binding-apollo-client-esbuild brotli 100,555 100,391 −164 (−0.2%) 🟢
binding-usehooks-ts-esbuild raw 91,202 91,206 +4 (+0.0%) 🔴
binding-usehooks-ts-esbuild gzip 30,573 30,574 +1 (+0.0%) 🔴
binding-usehooks-ts-esbuild brotli 27,219 27,283 +64 (+0.2%) 🔴

73 other measured values are unchanged.

@trueadm
trueadm merged commit 188d60b into main Oct 7, 2026
51 of 54 checks passed
@trueadm
trueadm deleted the perf/suspense-capability-split branch October 7, 2026 19:59
trueadm added a commit that referenced this pull request Oct 7, 2026
…nal scope

hydrate-frame (added on main by #1855) hydrates signal reads, so it ships
the signal engine. Against 188d60b's sources it is 2,030 B raw, 488 B gzip
and 437 B brotli smaller with this branch's engine, and no other minimal
scenario moves. The new budget is main's budget minus that delta, because
this machine measures main's own hydrate-frame 4 B over its budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 7, 2026
Conflicts: app-budgets.json and minimal-budgets.json, where #1854 and
#1855 lowered the rows this branch had tightened. Take main's values,
then write this branch's measurements (`--write-budgets`) on the merged
tree, which only lowers: bindings app gzip and total raw, one app
brotli, and three minimal gzip rows. hydrate-frame stays at main's
364,882 raw. It measures 364,886 here and on main alike, and main's own
CI fails the same check, so the raise belongs in a budget-only change on
main, not in this PR.

#1852 stops the Vite plugin parsing modules it only passes through, such
as the SSR chunks Nitro re-bundles. The @tsrx/core patch still bounds
every module the plugin does compile, so its guard now transforms a
540 kB project module that uses a hook instead of a Nitro chunk: about
2 s patched, 20 s unpatched, against a 6 s bound. The patch note says
so.

Reformat main's new hydrate-frame fixture; its output is unchanged once
position-derived ids are masked. main's changed test files pass on this
branch (bundler-compiler, compiler-vite-options, behavior-root,
binding-handoff, style-transaction-rollback).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
domgan-oai pushed a commit that referenced this pull request Oct 7, 2026
…#1851)

* perf(signals): install the public Scope surface only from createScope

Owner scopes that the runtime creates for compiled signal declarations never
reach application code, yet every signal application shipped the whole public
Scope implementation: serialization, inspection, trace recording and the
imperative derived$/get/set/isPending/batch/action methods.

ScopeImpl keeps one class shape. createScope installs the public-only methods
on its prototype the first time it runs, and only a debug scope installs trace
recording. The server's native-read driver installs the read serializer, so
clients never ship it. beginAdoption stays a method: hydration resolves it
through the owner, and importing the engine from the hydration path would pull
the engine into applications without signals.

An internal OwnerScope type omits the installed members, so internal code that
reaches for one fails to typecheck.

Signal applications are 871 to 1,118 B smaller gzipped; applications without
signals are byte-identical.

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

* fix(signals): keep native-read serialization off the server's import path

The server's native-read driver imported the engine to install the read
serializer. That loaded the engine, and its top-level batch-hook registration,
on every server render, including applications without signals, and Node's
strip-only TypeScript loader rejects the engine's parameter property
(register-hook direct server scripts failed).

serializeRead is a ScopeImpl method again, reached through the owner as on
main, so the server path and graph.ts match main. The server-render budget
returns to main's value. Signal applications are now 489 to 652 B smaller
gzipped; applications without signals stay byte-identical.

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

* test(hydration): read local scope state without the public inspect()

native-deferred-local-hook-diagnostics reached through a useSignal$ handle's
internal owner and called inspect(). Runtime-created scopes no longer carry the
public Scope surface unless the program calls createScope, and these cases
never do. Read the adoption leases and node count that inspect() reported
from the scope directly.

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

* fix(signals): hand out whole Scopes from the public owner routes

Runtime-created owner scopes reach application code: derived$ and query$ run
authored callbacks under them, so the public currentSignalOwner() returns one,
and a host SignalOwnerEnvironment carries them. Both are typed SignalOwner,
which narrows to Scope, but without an earlier createScope the scope lacked
inspect(), get() and the other installed methods.

currentSignalOwner and installSignalOwnerEnvironment exported from
octane/signals now install the public Scope methods before an owner can
escape; the runtime keeps owner-context's engine-free versions.
octane/server's carrier must stay engine-free, so SignalOwnerEnvironment now
carries owners as SignalOwnerIdentity values: a carrier stores and returns
them but cannot narrow them to Scope. Carriers that store SignalOwner values
compile unchanged.

bundle-boundaries builds each route in its own program without createScope
(the review's currentSignalOwner probe and a carrier that calls the owner it
carries); both fail with "inspect is not a function" without this change. A
type test pins the identity-typed carrier.

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

* perf(bundle-size): lower the hydrate-frame budget for the lighter signal scope

hydrate-frame (added on main by #1855) hydrates signal reads, so it ships
the signal engine. Against 188d60b's sources it is 2,030 B raw, 488 B gzip
and 437 B brotli smaller with this branch's engine, and no other minimal
scenario moves. The new budget is main's budget minus that delta, because
this machine measures main's own hydrate-frame 4 B over its budget.

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

* perf(bundle-size): re-measure hydrate-frame with #1857 and #1862 merged

With #1857 (in-place Block signal owners) and #1862 (unchanged adoption reads)
on main, this branch's hydrate-frame measures 364,278 raw, 112,866 gzip and
96,483 brotli. The budget is that measurement plus headroom: 364,310 /
112,898 / 96,616. That is below main's 366,064 / 113,343 / 97,053, so it lowers
rather than raises.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 13, 2026
…chability (#2032)

* test(bench): measure a rolldown + oxc split-chunk shell in bundle-reachability

A production rolldown + oxc app ships Octane as ESM chunks: `codeSplitting`
groups put the signal engine and the rest of the octane package in chunks of
their own, and the renderer loads on a dynamic-import chain. No reachability
fixture built that way, so nothing showed whether the optional-driver
eliminations from #1855 and #1942 survive chunk boundaries, or what each
chunk costs.

The split-shell fixture hydrates a server-rendered shell after activating a
renderer-free behavior island, with native reads of imported signals, a
visible() Hydrate boundary, a lazy route behind useTransition, @Try over
use(), a portal and a keyed list. It reports the whole application and each
group's chunk, rejects Octane modules in application chunks, and checks
through the source map that the runtime chunk drops the unused ViewTransition
and Activity drivers. The chunks run in jsdom linked into one script.

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

* test(bench): resolve the linked split-shell entry without platform paths

linkChunks found the entry chunk through path.relative, which joins with
backslashes on Windows while chunk file names stay POSIX. Pass the virtual
entry id as the link build's input instead.

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

* test(bench): list only each split-shell chunk's modules in its row

The runtime and signals rows measure one chunk each but recorded the whole
application's module list. Each chunk row now carries its own modules; the
behavior snapshot stays on every row because all rows come from the one
verified build.

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