Repository navigation
Pool the trackers of tracking frames - #21663
Merged
NullVoxPopuli merged 2 commits intoOct 6, 2026
Merged
Conversation
Each tracking frame made one Tracker, one Set, and one array from that Set. Frames are strictly nested, so beginTrackFrame now takes the tracker for its depth from a pool. A tracker keeps its tags in an array. A tag keeps the index at which a tracker took it last, in a new field `slot`. A tracker has the tag if its entry at that index is the tag, so a tag that the frame consumes again costs one comparison. resetTracking clears the pooled trackers. An untrack frame takes a depth but no tracker, so the pool can have holes. Split out of emberjs#21650. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 6, 2026
The comment blocks now show the tags array of a tracker, how `slot` finds a tag that the frame has already, the nested frame that gives a duplicate, and which tracker of the pool each frame depth uses. Comments only. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
NullVoxPopuli
marked this pull request as ready for review
October 6, 2026 03:46
ef4
approved these changes
Oct 6, 2026
Contributor
|
ci on a real app green here: NullVoxPopuli/limber#2288 (lots of unconventional reactivity timings, kinda) |
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.
A tracking frame no longer makes a
Tracker, aSetand an array. In a benchmark ofcreateCachegraphs, one update takes about half the time: the weighted mean is 0.6x ofmain.This is the first part of #21650, and it merges alone. Only
packages/@glimmer/validatorchanges.mainWhat changes
beginTrackFrametakes the tracker for its depth from a pool. Frames are strictly nested, so one tracker for each depth is enough.Set.slot. A tracker has the tag if its entry at that index is the tag. A tag that the frame consumes again costs one comparison.resetTracking()clears the pooled trackers.What changes for callers
slot.One edge case, and why the tracker uses an index
resetTracking()skips them.main, the tracker, itsSetandbeginTrackFrametook 27% to 45% of the samples.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.resetTracking(): with an open frame, and after a frame that began inside untrack frames.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