Repository navigation
perf: skip warm cache scans in new render episodes - #1024
Merged
domgan-oai merged 1 commit intoSep 9, 2026
Merged
domgan-oai merged 1 commit into
domgan-oai merged 1 commit into
Conversation
domgan-oai
marked this pull request as ready for review
September 9, 2026 19:49
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
octanepatch changeset.Partially addresses #981's parallel-use warm-plan item. This targets irrelevant adoption scans after prior warming; complex warm-plan allocation and other active-plan traversal work remain separate follow-ups.
Performance evidence
Baseline: merged main
7804852be69a78d11f3dc160f44d3bd358bedfc1. Same production fixture, Node 26.4.0, and Chromium 149.0.7827.55. Detailed Chromium coverage observes the parent-property read in the actual emitted runtime helper, without source probes.Adoption calls remain 33/129, all memo values and surviving DOM nodes match, and the no-warming control remains at zero adoption calls. A real pending retry retains one adoption, one cache probe, and two parent reads; parent and child resources each start once. The final zero-parent-step guard fails on the untouched baseline. This measures removed lookup work, not an end-user latency improvement.
Validation
<=causes two older-root failures. Both deliberate mutations were restored.pnpm typecheck:files packages/octane/src/runtime.tspnpm format:files:checkfor all changed files andgit diff --checkpnpm sync(no generated changes)pnpm test,pnpm typecheck, andpnpm format:checkwere not run locally; the core suite and scoped checks above cover the local change. Current-head CI passed all 26 jobs onc176cd00e2fdc01647a3488929003652e1b2efcf(attempt 2). The first attempt hit the same five-second Volar compiler-test timeout; that shard and one canceled shard passed unchanged on rerun. Cursor Bugbot completed successfully with no findings, and there are no review threads to resolve.Risk / follow-ups
The maximum is never reset or reduced, including when an older root resumes. An outdated maximum can only permit extra scanning; it cannot hide a matching cache. This adds no per-block fields, allocations, retained trees, or cache invalidation hooks. SSR has a separate runtime; client hydration and native resource adoption retain their existing semantics. Independent source review found no correctness issues.
The tests use a retained outer boundary around dynamic content so a root retry cache cannot hide a broken ancestor lookup. Active-plan recording stays intact because earlier completed siblings must still be remembered before later siblings suspend.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches suspense/memo warm-cache adoption in the client runtime; incorrect episode gating could break retries or duplicate fetches, though tests and benchmarks target those paths.
Overview
Skips pointless ancestor walks when
useMemoadoption runs in a render episode newer than every attached warm cache, while still calling adoption itself and leaving root-retry / pending-suspense paths unchanged.The runtime tracks
LATEST_WARM_CACHE_EPISODEwhen caches attach and gatesadoptWarmEntry’sparentBlockloop onCURRENT_WARM_EPISODE <= LATEST_WARM_CACHE_EPISODE, so ordinary sync memos after unrelated warming no longer scan the block chain (thousands of parent steps at depth 128).Adds a recursive-context warm-adoption benchmark (Chromium precise coverage on
adoptWarmEntry, zero parent-step ceiling after priming) wired intobench:work, plus parallel-use regressions for independent async roots alongside ordinaryuseMemoand sibling resource starts.Reviewed by Cursor Bugbot for commit c176cd0. Bugbot is set up for automated code reviews on this repo. Configure here.