Repository navigation
perf(lynx): specialize compact run teardown - #706
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
This was referenced Aug 11, 2026
[lynx-perf-live 1] Compact template-run teardown without lazy-state materialization
Huxpro/octane#43
Open
This was referenced Aug 12, 2026
1 task done
This branch was previously deployed
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
Specialize the Lynx host's complete teardown of a certified compact
mount-template-run.The current dense create path keeps first-mount host records lazy, but a 10k-row clear still validates and applies 100,000 teardown commands through the generic per-record path. On the attribution workload that meant 70,000 host records/event maps and put most of clear latency in host preparation/application.
This change retains a teardown-only dense certificate after an otherwise ordinary pure template run. A full clear may use it only after validating the complete event/remove/destroy stream, topology, generations, ownership, and absence of complex state. Mixed mutations, refs, lists, portals, main-thread props, native-list topology, or any mismatch remain on the existing generic path.
The fast path preserves synchronous PAPI removal/flush, native-event cleanup, destroy handle deltas and generations, terminal fault ownership, and the surrounding shell. It does not change the wire protocol or move cleanup past the measured boundary.
Tracks Huxpro#43.
Exact provenance
octanejs/octane@9b147781c9b4ec4df053a059633978ddc0ed922a8d8883c8ba01fd6061afbf3fec43df11ebd8d465Huxpro/lynx-js-framework-benchmark, byte-identical runner and production bundles for both entriesPerformance
Primary command (then repeated with entries reversed):
No accepted adverse decision cell remained:
Raw result SHA-256:
90d4449a5a5274c2a21a825930a185c28da73d6ff5ddd06a04743ef0580d078997ac1b4aa346dfa39c95a9bbbc6b394ec8776159db6706caf96a782c5bd2e2786be4565a103f8fe6da38a7f2b6ac0d68b7b1b60e64b13981b827a7a87743aff7d2eae84a155a0e935ac680bd6317ef91b7a5e64972970f72f6c643f868ea44ceAttribution and cleanup gates
The final instrumented lifecycle used two create/clear warmups, explicit CDP GC, then measured create/clear/page close on fresh pages. Every candidate repetition recorded exactly:
denseFastTeardowns = 1denseFastTeardownHosts = 70,000With the identical lifecycle:
All five baseline and candidate workers released. The final counter capture repeated the candidate three more times; every sample hit one 70,000-host teardown certificate, synchronously cleared, and released its worker.
Bundle impact
Production bundle gzip at the benchmark's 10k build:
Both are below the 5% gate.
@octanejs/lynxis private at0.0.0, so no changeset is applicable.Correctness and validation
Tests cover aborted preparation, exact shell/survivor identity, event removal, destroy-delta order, generation-2 repeated teardown and generation-3 ID reuse, empty-batch certificate preservation, and terminal cleanup after a fast-path PAPI fault. Removing the event cleanup assertion path made the new regression fail before it was restored.
Commands run:
The package-wide Lynx typecheck also reproduces the same existing
main-thread.ts:2197acknowledgement-narrowing error on the exact clean base; the changedhost-driver.tsscoped typecheck passes.Risk
The optimization is deliberately fail-closed. Certification walks and compares the exact accepted topology and teardown stream before mutation; any unsupported ownership or lifetime state falls back to the generic implementation. Once application begins, failures retain terminal cleanup ownership and still attempt the required flush, matching the existing accepted-fault contract.
Note
Cursor Bugbot is generating a summary for commit 8d8883c. Configure here.