Repository navigation
Description
Independent of [lynx-perf 2]/[lynx-perf 3]; assumes #1 landed (update path already minimal — this targets the mount/create path and the per-command constant). Current: create@10k = 4444ms vs vue-vdom 2133 / react 1717 (2.08×), ~160,000 commands (unchanged by #1).
The measured problem
The compiler already produces block-grade information: every host template is a hoisted universalPlan (structure tree + bindings/slot table) compiled into BOTH bundles (the MT slice carries the same plans for the first-screen renderer). The wire never uses it: mounting N rows ships per-node create/insert/update command objects which MT validates and applies node by node. The per-command volume (clone + staging + validation × 160k) is the excess; the LIS/keyed machinery itself is fine.
Honest expectation: vue-lynx's +b:c experiment showed create is PAPI-bound, not interpretation-bound — the win here is clone+validate+staging volume. Target the vdom tier (~2100–2600 on the reference host), not react's 1717 (that additionally needs code-staged MT create and a lighter runtime).
Change
- New command:
instantiate(planId, instanceId, slotValues[])— one command per plan instance (per Row), replacing that instance's per-node create/insert/update commands. Keyed mounts = one instantiate per item + existing LIS move/remove. - Plan identity: build-time registry (module-stable planId, e.g. hash of plan JSON) shared by both slices. MT resolves planId → plan and materializes via the same plan interpretation the first-screen renderer uses — one materialization code path for first frame and runtime mounts.
- Fail-safe (precedent: vue-lynx's template-hash fail-safe): MT can't resolve a planId (HMR skew, lazy chunks) ⇒ per-plan fallback to per-node commands. Never hard-fail. Covered by a test that deliberately drops a plan from the MT registry.
- Optional, measure first: flat-array command packing (opcode + operands; precedent RL snapshotPatch / vue-lynx ops) behind a define — let the rig decide if clone savings justify it.
Constraints
- Update-path commands unchanged; select/update10th must stay within noise.
- Adoption/first-screen hydration must accept instantiate-mounted trees (same plan interpretation ⇒ same shapes; assert with the two-realm rig).
Acceptance (rig)
- Deterministic: create@10k commands ~160k → ~10k+toolbar instantiates; commit bytes −50% or better.
- create@10k wall-clock in the 2400–3000ms band; create@1k proportional.
- FCP unchanged or better; fallback path tested.
Activity
Huxpro commentedon Aug 9, 2026
Implemented in #12 (draft, stacked on #11). Measured outcome against this issue's acceptance:
Deterministic rig (met):
create_commandsmodel floor, guarded inratios.json— the pre-change head measures 16.0×).plan-registrymessages.Wall clock (not reached, with runtime proof of why):
Generated by Claude Code
Huxpro commentedon Aug 11, 2026
Live-main audit (2026-08-11): superseded by octanejs#693 and octanejs#700. The old instantiate-by-plan wire reduced commands/bytes but expanded back into per-node work and did not move create wall time. Template programs/runs now execute certified dense hosts directly and own this architecture. Do not port the old plan-wire path.