Repository navigation
Use an index in the loop over the subtags of a combined tag - #21665
Merged
NullVoxPopuli merged 1 commit intoOct 6, 2026
Merged
Conversation
The `for...of` loop made one iterator for each computation of a combined tag. The loop keeps `Math.max`. A `>` comparison ignores the NaN revision of the volatile tag. Split out of emberjs#21650. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 6, 2026
NullVoxPopuli
marked this pull request as ready for review
October 6, 2026 03:30
ef4
approved these changes
Oct 6, 2026
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.
The loop over the subtags of a combined tag uses an index in place of
for...of. The change is three lines invalidators.ts.Alone, this change has no effect that the reactivity benchmark can separate from noise: the weighted mean is 1.0x of
main. It is a part of #21650, and it merges alone.mainWhat changes
subtag[i]with an index. Afor...ofloop over an array uses the iterator protocol.Math.max. A>comparison ignores theNaNrevision of the volatile tag, and a cache that reads that tag then runs one time only.All 20 cases
mainThe benchmark is https://github.com/NullVoxPopuli-ai-agent/ember-reactivity-bench. One measurement is the writes of one frame, then one flush that brings every output up to date. Each case of each build runs in its own process, pinned to one core. The numbers are the median of 6 mirrored rounds on Node 24.20.
The run has
main, each of the five branches, and #21650 as columns: table and method.Tests
type-check:internals, ESLint and Prettier pass.The parts of #21650
#21650 has all five changes in one branch. It stays open as the reference for the combined numbers. The five branches merge with no conflict, and their merge is the same code as the head of #21650.
mainTrackedValueon their first use0first in the value field of aTrackedValueRendering was measured for the combined change only:
pnpm benchshows 2.1% less script time, in this comment on #21650.🤖 Generated with Claude Code