Repository navigation
Description
Classification
Performance roadmap focused exclusively on the remaining Lynx table clear@10k
gap after upstream #748,
#749,
#750, and
#751. This is a teardown-specific
child of #51, not a replacement for its create/FCP, adoption, bundle, or native
tracks.
Problem statement
The original baseline of record (octanejs/octane@6079a680) measured
clear@10k at 706 ms versus React at 320 ms and the Vue cells at 229–295 ms.
The destroy-run work in upstream octanejs#750 removed the O(hosts) wire stream and
improved its AB/BA predecessor by roughly 19–26%, but the last measured
candidate still landed around 676–730 ms.
The improvement was real, but it did not close the cross-framework gap. The
remaining path is dominated by main-thread physical teardown rather than BTS
reconciliation:
- a compact
destroy-runis expanded on MTS into the certified per-host
event/remove/destroy sequence; - the dense fast path still performs one PAPI remove per row root (10,000
calls for the shared table) plus host-state cleanup for roughly 70,000
hosts; - warmed generations and retired ranges can force per-host handle or
acknowledgement work unless the exact compact path remains engaged; - DOM/custom-element removal, composed-tree predicate polling, and GC account
for most of the residual wall time.
The public benchmark's featured octane entry is still vendored from
6079a680; upstream main is now past all four PRs. No new optimization claim
starts until current main has a same-run baseline.
Objective
Iterate owner-first on teardown until Octane is as close as its observable
semantics and the shared Lynx PAPI allow to the same-run Vue/React cells.
Staged targets for clear@10k on the unchanged shared Web harness:
- Gate A: <= 1.5x the same-run React cell (the original [lynx-perf-live 8] Roadmap: close the create/FCP gap to the data-staged floor #51 acceptance).
- Goal: <= 1.1x React and <= 1.25x the fastest comparable Vue cell.
- Stretch: statistically indistinguishable from the best Vue/React tier in
both AB and BA entry orders.
These are goals, not permission to weaken teardown correctness, change the
benchmark workload/predicate, or introduce a Web-only shortcut that cannot be
explained against native semantics.
Loop protocol
Every iteration follows this loop and posts its complete ledger as an issue
comment:
- Measure one owner. Attribute BTS render, wire/clone, MTS
validate/expand, PAPI removal, handle publication/ACK, driver predicate,
and GC. A production experiment needs a directly measured owner >= 10% of
the decision cell. - State a falsifiable hypothesis. Include the expected counter/phase
movement, the semantic control, and a negative-control workload where the
win should disappear. - Implement one rollback-sized change. Keep fallback behavior unchanged
for explicit ids, refs, events, portals, partial/reordered runs, faults,
rollback, and drivers without the new capability. - Validate AB/BA. Same machine, lockfile, bundles, and harness; n>=7 in
both entry orders, zero DNF. Report medians, raw samples, CI, bundle/heap,
wire/message counts, and phase attribution. - Challenge cost transfer. Check create-after-clear, remove, replace,
startup/FCP, storms, MTS/BTS heap, GC, and subsequent generation reuse.
No tracked large cell may regress >5% in both orders without an explicit
accepted tradeoff. - Keep or revert. Land upstream only if the owner moved as predicted and
semantic controls stayed green. After merge, re-vendor upstreammainand
make that result the next iteration's baseline.
Stop an avenue after two well-powered NO-GO results or once its measured
collapsible share falls below 10%; move to the next owner instead of tuning
noise.
Work plan
0. Current-main baseline and honest boundary controls
- Re-vendor the featured entry from current unpatched
octanejs/octane/main
and run the full featured cohort in one window. - Run an additional attribution-only control that settles setup create work
before timed clear. Keep the published workload unchanged; use the control
only to distinguish teardown cost from predecessor boundary debt. - Archive entry commit, bundle hashes, host fingerprint, raw samples, zero-DNF
count, and same-run Vue/React ratios.
1. Phase ledger and deterministic counters
- Add/extend profiling for
destroy-rundecode, certificate validation,
synthetic-command construction, dense-store cleanup, PAPI calls,
acknowledgement construction/acceptance, predicate polling, and GC. - Record deterministic counts per clear: received run commands, synthesized
command objects, PAPI removes, materialized host records/deltas, generation
entries/ranges, ACK bytes, and retained state after GC. - Confirm whether the final perf: tear down removed collapsed runs with one destroy-run command octanejs/octane#750 correctness commits changed the fast-path hit
rate or only its validation.
2. Consume certified runs directly on MTS
- Prototype a dense teardown plan that validates and executes
destroy-run
from the accepted program/store without allocating the per-host command
array. - Preserve the explicit/partial/reordered fallback and exact rollback/error
contract. - Success criterion: synthesized command objects become O(runs), the targeted
MTS phase falls by >=50%, and clear wall improves outside variance.
3. Keep teardown ACK and generations O(runs) across warmed cycles
- Verify three or more create/clear cycles, reused ids, mixed generations,
partial removals, and rollback. - Remove any remaining path that materializes one handle delta or generation
tombstone per retired host when a certified run/range is sufficient. - Success criterion: clear ACK, new generation state, and retired metadata stay
O(runs) on every certified cycle, with no growth proportional to cleared
hosts.
4. Reduce physical PAPI removal calls
- Measure alternatives in isolation: current per-row root removal, scoped
range/subtree removal, parent-owned child clear, detach-and-replace, or a
negotiated bulk-remove capability. - Prefer an owning host abstraction over benchmark-app special cases. If the
public Lynx PAPI has no semantic bulk primitive, document the floor and
prototype the narrowest capability extension with a correct fallback. - Test native-facing ordering, event/ref cleanup, portals, lists, and foreign
siblings before accepting a Web win. - Success criterion: physical removal calls become O(runs/subtrees), or a
measured platform floor proves why they cannot.
5. Metadata, GC, and post-clear latency
- Attribute allocations retained or collected during run expansion, record
disposal, owned-node cleanup, handle publication, and retired-range
maintenance. - Pool/reuse only after lifetime and rollback invalidation are proven.
- Measure the whole create -> clear -> create cycle so work cannot be hidden
after the row-count predicate or shifted into the next create.
6. Re-rank and repeat
- After each accepted upstream PR, publish a new full featured-cohort run and
update the owner ledger. - Open the next implementation issue/PR only for the largest remaining >=10%
owner. - Continue until the Goal is met or every remaining gap is a measured shared
PAPI/browser/harness floor; document any residual floor with a negative
control rather than claiming parity.
Correctness matrix
- complete and partial run clear; reordered and explicit-path rows
- refs, main-thread props/events, portals, lists, foreign siblings
- reused ids and non-uniform generations across repeated cycles
- faulted roots, apply failure, rollback, stale/duplicate ACK
- first-screen/adopted trees and root disposal
- drivers with and without teardown/bulk-remove capabilities
- Web and native semantics kept distinct; no native claim from Web-only data
Deliverables per iteration
- baseline/candidate bundles with provenance and hashes
- raw AB/BA result files and concise phase/counter report
- regression tests that fail on the prior behavior
- one upstream draft PR with explicit performance and risk ledger
- post-merge featured benchmark refresh and issue comment
Non-goals
- benchmark-specific DOM or predicate shortcuts
- removing required user cleanups, ref/event detachment, generation checks, or
rollback validation - more wire encoding work without a newly measured wire owner
- exact percentage claims across different hosts or separate benchmark runs
- declaring Vue/React parity from a stale featured entry
Provenance
- An agent authored this issue (
agent-authored).
Activity
Huxpro commentedon Aug 15, 2026
Iteration ledger: direct pristine dense teardown
Upstream draft PR: octanejs/octane#762
Head:
5c4addb8bb3473f7487cdc9552ca2d1f531cef4aBaseline and hypothesis
octanejs/octane@63eb788817ff91b841b5f0fd24321ae16e7f4396, rebuilt on the same lockfile and machine as the candidate.Kept change
createLynxElementPAPIexposes the already receiver-bound raw remove function; profiling counters remain compile-time gated. Absence of the profile global/fields was verified in supported Rspeedy/Rspack production bundles (not claimed for arbitrary bundlers).Decision result
Same machine (
65160668d8d9, Xeon Platinum 8336C), pinned Playwright Chromium 1228, production bundles,n=7, zero DNF:The issue Goal (
<=1.1× React,<=1.25×fastest comparable Vue) is met in both reportable orders. One earlier reverse cohort was 308.100 ±16.300 ms / 1.272× Vue; the identical-order repeat above passed, and the noisy cohort is disclosed rather than discarded.Adjacent baseline/candidate AB/BA:
Attribution and cost transfer
Semantic controls and validation
packages/lynx/tsconfig.testing.json: pass.pnpm sync, andgit diff --check: pass.Rejected avenues / measured floor
__ReplaceElements: 321.890 ms vs 312.695 ms control; Web Core still loops DOM removals internally.The remaining dominant owner is the shared 10,000-call PAPI/DOM removal floor.
Artifacts
The archives were decompressed and compared semantically with their source runner JSON; all nine archive hashes and all 16 baseline/candidate bundle hashes were verified. The post-merge featured refresh remains intentionally after maintainer merge.
This iteration and comment were agent-authored.