You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[lynx-perf 7] Receiver diet: shrink the MT slice, spend it on FCP #8
Independent; best after [lynx-perf 5]/[lynx-perf 6] (they delete code this issue then ships less of).
The measured problem
The lynx bundle for the reference table app is ~102.8KB gzip; octane's own baselines split a same-scale app at ~59KB MT / ~51KB BG. The MT slice — receiver, per-command staging/validation, ack machinery, worklet bridge, one-shot renderer — outweighs an entire vue vdom app (40.7KB all-in) and must be evaluated before first paint. FCP@10k ≈ 1090ms vs vue band 795–949 vs ReactLynx 459 (32KB all-in, code-staged first frame — that tier is structural; the vue band is the target).
Lazy-init the worklet bridge (~1.8k lines): load/register on first 'main thread' usage; apps without worklets pay zero. Assert with a string probe on a no-worklet app's bundle.
Unify the one-shot renderer's plan materialization with the receiver's ([lynx-perf 4] unified them semantically — unify the bytes).
Add gzip-per-slice to the rig's deterministic gates (the .web.bundle sections are ground truth).
Constraints
No behavior changes; every removal is a define or a lazy boundary with a test.
Bundle-shape gates in benchmarks/baselines/ratios.json updated with justifications, not deleted.
Measured outcome, shipped as PR #15 (stacked on #14).
What shipped
Lazy worklet bridge (item 2): the receiver now reaches the worklet registry only through a side-effect-free bridge slot (core/worklet-bridge.ts), provided by main-renderer.ts's thread-function entry points. A no-worklet main-thread bundle sheds the entire registry/call-bridge machinery; worklet traffic arriving anyway reports cleanly. Both directions are pinned by esbuild tree-shaking probes and behavioral no-bridge tests.
Per-slice gzip gates (item 4): frozen slice-budget-preview/slice-budget-ifr reference targets in lynx-bundle-size, four new ratio guards (preview-main, IFR-main, background, whole-bundle; 1.03× headroom). Red-checked: breaking the bridge boundary breaches both main-slice budgets by +2.3 KB.
Diagnostics-string diet (item 1): rejected with data. The prod MT slice carries 69 diagnostic strings, 10,153 raw bytes — but stripping all of them moves the slice only −234 bytes gzip (repetitive prose is nearly free under gzip, and gzip is the gate metric). The self-audit path was already dev-folded by [lynx-perf 5]; the prod slice contains zero validate/selfCheck occurrences.
Plan-materialization unification (item 3): assessed, not forced.renderPlanNode is a live renderer (components, control flow, slots, suspense, context); plan-wire.ts's expansion is a static command stamper. Shared surface is a few dozen lines of prop/text canonicalization — well under 1 KB gzip for real first-screen regression risk. Not a good trade under the no-behavior-change constraint.
Acceptance, honestly
MT gzip −25% (→ ≤45 KB): not met — measured −3.6%. The projection was made on unminified module shares; production usedExports DCE had already dropped most of the projected mass, and [lynx-perf 5/6] had already dev-folded validation/handles. The two remaining projected levers measure at −234 B and <1 KB.
Whole bundle ≤80 KB: not met (128.8 KB fixture IFR; the ~102.8 KB anchor predates the stack's features and toolchain). Both slices now sit under frozen budget gates so growth is a red build.
FCP@10k: no resolvable delta — interleaved A/B on the same host window (baseline medians 4,390/4,075/4,013 ms vs after 4,128/4,109/4,945 ms) is inside ±900 ms host noise; the ~800–900 ms band belongs to the pre-migration host. Slope unchanged by construction (no per-row work touched).
Every removal is a lazy boundary with a test: met. Gates updated with justifications, not deleted: met.
Live-main audit (2026-08-11): exact bridge patch rejected; successor is #44. A live-main reimplementation recovered about 1–3% gzip but regressed expanded reverse selectStorm@10k by 20.2%. #44 keeps the no-worklet cold-feature goal while requiring a compiler/capability-owned split and forward/reverse runtime gates.
Activity
Huxpro commentedon Aug 9, 2026
Measured outcome, shipped as PR #15 (stacked on #14).
What shipped
core/worklet-bridge.ts), provided bymain-renderer.ts's thread-function entry points. A no-worklet main-thread bundle sheds the entire registry/call-bridge machinery; worklet traffic arriving anyway reports cleanly. Both directions are pinned by esbuild tree-shaking probes and behavioral no-bridge tests.slice-budget-preview/slice-budget-ifrreference targets inlynx-bundle-size, four new ratio guards (preview-main, IFR-main, background, whole-bundle; 1.03× headroom). Red-checked: breaking the bridge boundary breaches both main-slice budgets by +2.3 KB.Measured (tasm decode + gzip -9, medians, baseline = #14 head):
Items resolved by measurement instead of code
renderPlanNodeis a live renderer (components, control flow, slots, suspense, context);plan-wire.ts's expansion is a static command stamper. Shared surface is a few dozen lines of prop/text canonicalization — well under 1 KB gzip for real first-screen regression risk. Not a good trade under the no-behavior-change constraint.Acceptance, honestly
usedExportsDCE had already dropped most of the projected mass, and [lynx-perf 5/6] had already dev-folded validation/handles. The two remaining projected levers measure at −234 B and <1 KB.Generated by Claude Code
Huxpro commentedon Aug 11, 2026
Live-main audit (2026-08-11): exact bridge patch rejected; successor is #44. A live-main reimplementation recovered about 1–3% gzip but regressed expanded reverse selectStorm@10k by 20.2%. #44 keeps the no-worklet cold-feature goal while requiring a compiler/capability-owned split and forward/reverse runtime gates.