Repository navigation
perf: reuse keyed-list chain on first-fill unwind - #1006
Merged
domgan-oai merged 1 commit intoSep 9, 2026
Merged
Conversation
Closed
68 of 84 tasks
domgan-oai
marked this pull request as ready for review
September 8, 2026 23:01
14 of 21 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
Reuse the keyed list's existing sibling chain to unwind a completed first-fill prefix after a later row throws or suspends. This removes the
mountedarray and its per-row push from the successful 0→N path. Part of #981.Why
Each completed row is already linked to its predecessor. The previous implementation kept a second array only to traverse those rows backwards in the exceptional cleanup path.
Changes
prevSiblingbackwards on failure, saving the predecessor before unmount; preserve the existing map deletion, warm-memo retention, DOM detachment, and list-state reset.octanepatch changeset.Validation
pnpm format:check(not run; changed-file check below)pnpm typecheckpnpm test(not run; targeted suites below)pnpm exec vitest run packages/octane/tests/for.test.ts --reporter=dot(176/176 in development and production);pnpm exec vitest run packages/octane/tests/hydration/for-hydrate.test.ts packages/octane/tests/hydration/emptyfor-hydrate.test.ts packages/octane/tests/hydration/descriptor-list-hydrate.test.ts --reporter=dot(54/54)pnpm format:files:check packages/octane/src/runtime.ts packages/octane/tests/for.test.ts .changeset/reuse-linear-list-chain.md;git diff --check;pnpm syncProduction source bundles from the same esbuild 0.28.1 toolchain changed from 352,272 to 352,247 raw bytes (110,542 to 110,522 gzip). A public
createRoot/createElementgeneric keyed component list preserved the 256-row output hash and survivor DOM identity. In nine paired rounds of 16 first-fill/clear cycles, medians were 20.6454 → 20.6623 ms in baseline-first order and 22.1264 → 22.0019 ms in candidate-first order. Timings overlap and do not establish a throughput gain; the deterministic change removes one throw-only array and 256 pushes from that workload.The configured Secretive signing agent refused two signing attempts. GitHub main branch protection does not require signed commits, so this PR's commit is unsigned.
Risk / follow-ups
The cleanup path now follows the same backward link pattern already used by the certified host-only mount path. It saves each predecessor before unmount to withstand link changes during teardown. Larger first-fill timings were GC dominated and not usable as performance evidence.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.