Skip to content

Keep AppendingBlockImpl edge fields monomorphic - #21610

Open
NullVoxPopuli wants to merge 1 commit into
emberjs:mainfrom
NullVoxPopuli:nvp/perf/block-edges-monomorphic
Open

Keep AppendingBlockImpl edge fields monomorphic#21610
NullVoxPopuli wants to merge 1 commit into
emberjs:mainfrom
NullVoxPopuli:nvp/perf/block-edges-monomorphic

Conversation

@NullVoxPopuli

@NullVoxPopuli NullVoxPopuli commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

A block's first and last edge is either a DOM node or a nested block, so they now live in separate first/firstBlock and last/lastBlock fields instead of wrapping nodes in First/Last objects. This removes two allocations per appended node and keeps the reads in clear() monomorphic.

Split out of nvp/simplify-some-vm-hot-paths.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@NullVoxPopuli

Copy link
Copy Markdown
Contributor Author

Benchmark: main (bdb2580) vs nvp/perf/block-edges-monomorphic (1be8e21)

Ran via pnpm bench (the krausest js-framework-benchmark scenario in smoke-tests/benchmark-app, tracerbench, 20 samples each, 8x CPU throttle). Negative delta means the PR is faster. Only rows tracerbench marks significant (p < 0.05) are meaningful.

Phase main median PR median Δ (estimator) 95% CI Significant
Total duration 8,821ms 9,069ms 131ms (+1.5%) -121ms .. 337ms
render 138ms 137ms 0ms (-0.1%) -5ms .. 4ms
render1000Items1 325ms 331ms 0ms (-0.0%) -5ms .. 10ms
clearItems1 35ms 35ms 0ms (+1.2%) -1ms .. 2ms
render1000Items2 273ms 271ms -3ms (-1.1%) -16ms .. 4ms
clearItems2 133ms 133ms 0ms (-0.2%) -2ms .. 2ms
render10000Items1 2,569ms 2,620ms 23ms (+0.9%) -62ms .. 103ms
clearManyItems1 358ms 359ms -1ms (-0.3%) -7ms .. 5ms
render10000Items2 2,528ms 2,563ms -10ms (-0.4%) -90ms .. 85ms
clearManyItems2 251ms 250ms -3ms (-1.2%) -10ms .. 4ms
render1000Items3 231ms 249ms 6ms (+2.5%) -7ms .. 25ms
append1000Items1 327ms 340ms 3ms (+0.9%) -24ms .. 35ms
append1000Items2 300ms 318ms 11ms (+3.8%) -4ms .. 36ms
updateEvery10thItem1 271ms 271ms -4ms (-1.3%) -12ms .. 12ms
updateEvery10thItem2 280ms 288ms -1ms (-0.2%) -16ms .. 19ms
selectFirstRow1 70ms 75ms 3ms (+5.0%) -3ms .. 7ms
selectSecondRow1 55ms 56ms 1ms (+1.0%) -5ms .. 5ms
removeFirstRow1 179ms 176ms -3ms (-1.4%) -10ms .. 6ms
removeSecondRow1 168ms 173ms 2ms (+0.9%) -6ms .. 11ms
swapRows1 113ms 114ms 0ms (+0.1%) -5ms .. 8ms
swapRows2 111ms 113ms 1ms (+1.1%) -4ms .. 9ms
clearItems4 99ms 102ms 2ms (+2.0%) -1ms .. 5ms
paint 10ms 12ms 1ms (+6.5%) -2ms .. 4ms

@NullVoxPopuli NullVoxPopuli changed the title [PERF] Keep AppendingBlockImpl edge fields monomorphic Keep AppendingBlockImpl edge fields monomorphic Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant