Hoist _children into a local in constructNewChildrenArray - #5198
Merged
Conversation
📊 Tachometer Benchmark ResultsSummaryduration
usedJSHeapSize
Resultscreate10kduration
usedJSHeapSize
filter-listduration
usedJSHeapSize
hydrate1kduration
usedJSHeapSize
many-updatesduration
usedJSHeapSize
replace1kduration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
text-updateduration
usedJSHeapSize
tododuration
usedJSHeapSize
update10th1kduration
usedJSHeapSize
|
|
Size Change: -5 B (-0.03%) Total Size: 15.9 kB 📦 View Changed
ℹ️ View Unchanged
|
JoviDeCroock
force-pushed
the
JoviDeCroock/issue-2618-algo-learnings
branch
from
August 7, 2026 03:54
9e45692 to
ea85854
Compare
Every normalization branch in the loop wrote through `newParentVNode._children[i]`, reloading the property each time. Bind it once and write through the local instead. -5 B brotli (4582 -> 4577), performance-neutral across update, mount, keyed-reorder and hydration benchmarks. This replaces the earlier "avoid allocating arrays for single children" approach from this branch. Passing the single child unwrapped did win 3-7% on update10th1k, but it cost ~3% on first-paint hydration, so it was dropped. For the record, hydrate1k's reported 45-55% regression on that earlier version was a measurement artifact, not a throughput regression: the benchmark does exactly 5 warmup hydrations and times the 6th, and each iteration clones and discards ~8000 DOM nodes, which produces a deterministic periodic slow hydration every ~4-5 iterations. Each build has its own phase. Timing only #6 sampled the patched build's slow phase. Holding the build pair fixed and varying only the warmup count gave -16.8% / +30.8% / +6.4% / +0.9% / -21.8% / +7.0% for hydrations 5-10 (mean ~+1%), while a main-vs-main control over the same protocol stayed flat at +0.2% / -0.5% / -1.3%. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JoviDeCroock
force-pushed
the
JoviDeCroock/issue-2618-algo-learnings
branch
from
August 7, 2026 03:57
ea85854 to
16c12ed
Compare
_children into a local in constructNewChildrenArray
JoviDeCroock
marked this pull request as ready for review
August 7, 2026 04:02
marvinhagemeister
approved these changes
Aug 7, 2026
Merged
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.
Every normalization branch in
constructNewChildrenArray's loop wrote throughnewParentVNode._children[i], reloading the property on each branch. Bind it once and write through the local instead.−5 B brotli (4582 → 4577), performance-neutral everywhere.
Fixed up by Claude opus