Repository navigation
test(bench): track native-read overhead with a plain app-frame twin - #2037
Merged
Merged
Conversation
frame-plain hydrates the same frame with no octane/signals import, reading the same store through useSyncExternalStore. The run checks the twin's server HTML matches frame's less the seed script, and reports the paired frame/frame-plain ratio plus client bundle bytes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
View logs |
octane-website | 2d93883 | Oct 13 2026, 11:12 AM |
trueadm
marked this pull request as ready for review
October 13, 2026 11:12
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
View logs |
octane-website-mcp | 2d93883 | Oct 13 2026, 11:12 AM |
Contributor
Benchmark report🟢 No byte growth, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 93 measured values. Public-import reachability bundles (bytes)No changes across 111 measured values. |
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
frame-plainscenario tobenchmarks/app-frame-hydration: the same ~1,650-Block frame with nooctane/signalsimport anywhere, reading the same five values throughuseSyncExternalStore.frame/frame-plainratio, cold and warm, beside the existing head/base ratios, plus each scenario's minified client bytes. That tracks what native reads cost a frame that barely reads a signal.Why
A production signals-enabled app frame showed that importing
octane/signalsin every module costs hydration time even where almost nothing reads a signal. On current main (5594cb0, 20 pairs, 4× CPU, headless Chromium):frameframe-plainframe/frame-plainWithout a twin the harness could only compare a change with its base, never with the plain-hydration floor.
Changes
src/plain/: copies of the four modules that read a signal (composer,header,primitives,sidebar), each reading the store throughuseSyncExternalStore, plusstore.ts, a tiny external store standing in forsignal$.run.mjs: a-plainscenario builds with a small Vite plugin (plainTwin). It rewrites the'octane/signals'specifier insrc/toplain/store.ts, so no module compiles with native reads or signal bindings, and resolves a frame import of a signal-reading module to itsplain/copy.frame.tsrx,state.ts,client.tsandserver.tsare shared.frame's, less the native seed script. Today they match byte for byte.client.tsdrains passive effects before the verification click, becauseuseSyncExternalStoresubscribes in one. This is outside the timed window and does nothing for the signals frame.roundOrder) so the frame/plain pairs are interleaved like head/base pairs.bench.mjssuite note describe the twin and the drift rule: a change to a signal-reading module belongs in itssrc/plain/copy too.Validation
node benchmarks/app-frame-hydration/run.mjs 20on main: numbers above, all verifications pass (adoption, no recoverable errors, delegated click re-renders the reading arm, clean unmount).--base=<checkout>runs pair both head/base and frame/frame-plain per candidate. Used for the follow-up PRs that cut the gap.octane-tsc -p benchmarks/app-frame-hydration/tsconfig.json: no errors in benchmark files.pnpm format:files:check benchmarks/app-frame-hydration benchmarks/bench.mjspnpm sync: no generated changes.pnpm test/pnpm typecheck: not run; benchmark-only change.perf-review: not applicable (no runtime, compiler or binding source).concise-code: src +0 −0 (runtime +0 −0); new files: the fourplain/*.tsrxtwins andplain/store.ts, needed because the twin must read through hooks where the frame reads natively. Alternatives: a full copy of the fixture (~770 lines, every module free to drift) or deriving the twin with a source transform of.get()reads (fragile, hides what is measured). The redirect plugin keeps the shared modules shared, and the server-HTML check catches drift in the copies. Bytes: not applicable.Risk / follow-ups
Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Low Risk
Benchmark and fixture-only changes; no production runtime, compiler, or binding code paths are modified.
Overview
Adds a
frame-plain(and matching*-plain) path to the app-frame hydration benchmark so the same ~1,650-Block fixture can be built withoutoctane/signals/ native reads, using a ViteplainTwinplugin that swaps insrc/plain/store.tsand redirects signal-reading modules touseSyncExternalStoretwins.The harness now defaults to three scenarios, builds signals vs plain client/server variants, fails if plain SSR HTML diverges from signals (minus the native seed script), reports
frame/frame-plainpaired cold/warm ratios alongside head/base, recordsclientBytes/clientGzipBytes, and rotates scenario order per round. Verification callsdrainPassiveEffectsbefore the sidebar click so the plain twin’s subscriptions are active outside the timed hydrate window.Docs in
README.mdandbench.mjsdescribe the twin and maintenance rule: signal-reading changes need matchingsrc/plain/copies.Reviewed by Cursor Bugbot for commit 2d93883. Bugbot is set up for automated code reviews on this repo. Configure here.