Skip unchanged {{#each}} item subtrees during updates - #21544
Closed
NullVoxPopuli-ai-agent wants to merge 2 commits into
Closed
NullVoxPopuli-ai-agent wants to merge 2 commits into
NullVoxPopuli-ai-agent wants to merge 2 commits into
Conversation
This was referenced Aug 6, 2026
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
The UpdatingVM walks every updating opcode of every list item on every render: cache groups (JumpIfNotModifiedOpcode) exist only at component boundaries, so a list of plain template rows revalidates every binding even when nothing in a row changed. Collect each item's consumed tags in a tracking frame (via a new frame-finalizer hook on UpdatingVMFrame) and skip the item's entire subtree while that combined tag validates. Trivial items opt out: for a text node or two, validating a combined tag costs as much as updating, so collection would be pure overhead. An item is trivial when it has <= 2 opcodes and no nested block -- a nested block child means an arbitrarily large subtree hides behind a small top-level count. dbmon-style workloads (fat rows, sparse changes): ~1.6x fps at 8x CPU throttle, ~6x (rAF-capped) at 4x. Dense-change / tiny-item workloads and the krausest bench: neutral. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
NullVoxPopuli-ai-agent
force-pushed
the
extract-each-skip
branch
from
September 30, 2026 14:45
b4009e1 to
f3aaa81
Compare
Contributor
Author
|
Tracerbench PDF for a run with Ember's script time is 40 to 41% lower on update-every-10th, 21 to 22% on remove, and 29 to 31% on swap. Selecting the second row is 15.7% slower, as in both earlier runs. The final In the same setup, #21557 measured update -40%, remove -20 to -25%, swap -23%, selectSecondRow1 +9.9% slower, and a 6.6% slower first append.
How this was measured
|
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.
Re-cut of #21512 (closed during the #21520 spike consolidation) onto current
main, now with the full-suite verification that was outstanding: 9443 tests, 0 failures locally.During revalidation, each
{{#each}}item collects the tags its subtree consumed (via a tracking-frame finalizer on the item's try-frame); on later passes, an item whose collected tag validates clean is skipped entirely instead of walking every opcode of its subtree. A triviality gate (≤2 opcodes and no nested block) keeps the bookkeeping off items too small to profit. Measured standalone at ~1.9x on an 8x-throttled dbmon (walk-heavy, many clean items per frame); no observable behavior change — the same subtrees re-render for the same reasons, cheaper.This was the campaign's first lever and its most reviewed artifact; it needs no RFC, no flag, and composes with (but does not require) the scheduler work in #21493/#21520.
🤖 Generated with Claude Code