Repository navigation
perf: reuse universal owner draft collections - #1009
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:12
Closed
68 of 84 tasks
10 of 11 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
seenEffects,children, andclaimedChildrencollections already allocated with a fresh universal owner draft on its firstexecuteOwnerpass. Render-phase retries still discard children and effects from the abandoned pass.Validation
pnpm format:check(scoped formatting check used)pnpm typecheck(scoped typecheck used)pnpm test(focused universal suite used)pnpm format:files:check packages/octane/src/universal-core.ts packages/octane/tests/universal-state-updates.test.ts benchmarks/bench.mjs benchmarks/README.md benchmarks/universal-owner-drafts/run.mjs benchmarks/universal-owner-drafts/README.md .changeset/reuse-universal-owner-draft-collections.mdpnpm typecheck:files packages/octane/src/universal-core.ts packages/octane/tests/universal-state-updates.test.ts./node_modules/.bin/vitest run packages/octane/tests/universal*.test.ts --reporter=dot— 36 dev/prod files, 714 tests passed../node_modules/.bin/vitest run packages/octane-mcp-server/src/index.test.js --reporter=dot— 15 tests passed, including benchmark suite and MCP schema synchronization.node benchmarks/bench.mjs --quick universal-owner-drafts— semantic controls passed.pnpm sync— no additional generated changes.Performance evidence
Node 26.4.0 on macOS arm64; production bundles from merged
mainand this branch, 13 samples × 20 accepted updates per process, sequential baseline–candidate–candidate–baseline. Scores in ms/update: 128 owners0.1363 / 0.1187 / 0.1237 / 0.1256; 1,024 owners1.3296 / 1.1435 / 1.1499 / 1.1921. Zero- and one-owner controls were effectively flat. Every run had matching output hashes, retained host identities, all changed-prop child renders, and zero structural commands. Process variation is material, so these measurements support a modest improvement in this synthetic owner-heavy workload rather than an application-wide claim.Risk / follow-ups
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches universal render/retry semantics in
executeOwner; mitigated by a detailed retry test for effects, identity, and events, though browser/native paths are not separately exercised.Overview
Reuses per-owner draft scratch collections on the first
executeOwnerpass instead of clearingchildren/seenEffectsand allocating a freshclaimedChildrenset every time. Render-phase retries (renderCount > 0) still callresetDraftChildrenand resetseenEffectsso abandoned passes are not published.Adds a Node-only
universal-owner-draftsbenchmark (0/1/128/1,024 keyed child owners with forced prop churn, identity and zero-structural-command gates) and wires it intobench.mjs. Adds a regression test for keyed lists across a render-phase retry: stable survivor identity, correct effect cleanup/mount, and no events on torn-down hosts.Patch-level octane changeset; targets owner-draft allocation overhead from #981.
Reviewed by Cursor Bugbot for commit 5cfe97b. Bugbot is set up for automated code reviews on this repo. Configure here.