Repository navigation
perf: cut universal native hover allocation with lazy replay identities - #1010
Merged
domgan-oai merged 2 commits intoSep 9, 2026
Merged
domgan-oai merged 2 commits into
domgan-oai merged 2 commits into
Conversation
domgan-oai
marked this pull request as ready for review
September 9, 2026 08:34
Closed
68 of 84 tasks
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
Why
Issue #1007 reports 3.88 GB cumulative JavaScript allocation and heavy Hermes GC in a 20-row native hover workload. The renderer was eagerly building replay identities for every owner on every update even when no memo suspended. That work is now paid only by pending memo replay.
Performance evidence
On Node 26.4.0/V8, macOS arm64, in the same public compiled object-driver workload and with the same 2 KiB Inspector allocation sampler (including objects collected by GC), a warmed 20-row, 2,000-hover sample allocated an estimated 2,334,311,200 → 1,495,282,392 bytes (−839,028,808 bytes; −35.9%). These were separate immutable production builds from
f86fb48cand the original lazy-replay diff, before #1009 merged. Both runs verified stable host structure, correct selection, and teardown. The 80/20 same-run hover timing ratio on this branch was 4.97 against an 8.0 guard; concurrent local tests made absolute timings noisy. Builtuniversal-core.jschanged by +50 raw bytes and +63 gzip bytes. After merging #1009, both production benchmark suites passed their semantic controls; the hover 80/20 timing ratio was 4.24 against the 8.0 guard.Validation
pnpm sync— no generated changes, including after merging currentmain(0ba4016c).pnpm format:files:checkon changed files../node_modules/.bin/vitest run packages/octane/tests/universal*.test.ts --reporter=dot— 714/714 tests in dev and production after the final runtime edit../node_modules/.bin/vitest run packages/octane-mcp-server/src/index.test.js --reporter=dot— 15/15 tests after adding the suite list entry../node_modules/.bin/vitest run packages/octane/tests/universal*.test.ts packages/octane-mcp-server/src/index.test.js --reporter=dot— 731/731 tests across 37 files.pnpm --filter octane exec tsrx-tsc --noEmit --project tsconfig.json.BENCH_OCTANE_DIST=<production dist> BENCH_ALLOCATION_JSON=<profile> node benchmarks/universal-native-hover/run.mjs 1— both pinned builds passed semantic checks and yielded the profiles above.pnpm format:check.pnpm typecheck.pnpm test— full local run encounters macOS Chromium sandbox launch failures (MachPortRendezvousServerpermission denied); targeted native suite and CI are the relevant gates. The run also exposed the benchmark list omission, now fixed and retested.Risk / follow-ups
octane/universal/nativeon Hermes #1007 should remain open for further owner/materialization work and a Hermes rerun.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes universal-core Suspense memo replay identity construction; incorrect ordinals or lazy paths could mis-associate pending memos across siblings or retries, though new and existing universal tests target this.
Overview
Defers building universal owner replay paths until Suspense needs to match a pending memo (
findSuspendedMemo/collectSuspendedMemoscallownerReplayPath). Ordinary native updates no longer eagerly maintainchildReplayOrdinalsor a replay segment for every nested owner claim.Unkeyed sibling ordinals for replay matching now come from a
priorClaimedSiblingclaim chain (including retained Activity owners), replacing per-render identity-index updates. A semantics regression covers distinct nested pending memos after a render-phase retry.Adds the
universal-native-hoverNode benchmark (issue #1007): compiled 20/80-row, four-layer hover selection with correctness probes, an 80/20 timing ratio guard, and runner/MCP registration. Patch changeset documents the allocation win.Reviewed by Cursor Bugbot for commit ecf1ed3. Bugbot is set up for automated code reviews on this repo. Configure here.