Repository navigation
perf: reuse child-only warm plans - #1020
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 9, 2026 17:33
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
Compiled components with independent same-module children register a warm plan on every render. The old path allocates an empty batch array, a child-plan closure, and a registration object even when the tree renders synchronously.
Reuse the existing attached child-only plan with the current props, and store registrations as flat block/plan/props triples. A descendant's first pending read still starts independent sibling requests, including on later updates.
Performance evidence
Same-machine production Chromium call counts against base
266302ef9:useBatchregistrations beforeuseBatchregistrations afterRoot/partial text writes remain exactly 1024/32; the TSX control uses neither registration helper. The own-promise control retains four batch calls, starts each parent/child resource once, and renders the expected values. Reassignment, local-shadow, context-cache, DOM, and survivor-identity controls pass. Timing is diagnostic only; this PR claims removal of the measured registration work and associated explicit allocations, not a wall-clock speedup.
Validation
pnpm format:files:check, sourcepnpm typecheck:files,git diff --check, andpnpm sync.pnpm typecheck.pnpm test— broad sandboxed run interrupted after HTTP/browser access failures and unrelated package failures; the targeted HTTP/browser retry above passed. Repository CI will provide the complete suite result.pnpm format:check— scoped formatting used instead.Risk / follow-ups
The optimization is deliberately limited to plans proven to contain only child traversal with stable captures. The legacy fallback still allocates its array/closure, and the warm-memo ancestor traversal in #981 is separate work. Registration remains active before any suspension has occurred so first-request parallel discovery is preserved.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Cursor Bugbot is generating a summary for commit 18296d0. Configure here.