Skip to content

Flatten VM opcode dispatch - #21604

Open
NullVoxPopuli wants to merge 1 commit into
emberjs:mainfrom
NullVoxPopuli:nvp/perf/flatten-opcode-dispatch
Open

Flatten VM opcode dispatch#21604
NullVoxPopuli wants to merge 1 commit into
emberjs:mainfrom
NullVoxPopuli:nvp/perf/flatten-opcode-dispatch

Conversation

@NullVoxPopuli

@NullVoxPopuli NullVoxPopuli commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Machine opcodes are handled inline in LowLevelVM.evaluate and everything else dispatches straight to a Syscall function,
removing the { syscall, evaluate } wrapper objects and the
extra isMachine assertion on every instruction.

AppendOpcodes.add no longer accepts a 'machine' kind since nothing registered one.

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

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@NullVoxPopuli NullVoxPopuli changed the title [PERF] Flatten VM opcode dispatch Flatten VM opcode dispatch Sep 9, 2026
@NullVoxPopuli

Copy link
Copy Markdown
Contributor Author

Benchmark: main (bdb2580) vs nvp/perf/flatten-opcode-dispatch (c825478)

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 9,043ms 8,998ms -130ms (-1.4%) -320ms .. 86ms
render 138ms 139ms 0ms (+0.3%) -4ms .. 7ms
render1000Items1 334ms 324ms -12ms (-3.6%) -20ms .. -6ms ✅
clearItems1 36ms 35ms 0ms (+0.4%) -1ms .. 1ms
render1000Items2 276ms 272ms -4ms (-1.4%) -14ms .. 2ms
clearItems2 135ms 135ms 0ms (+0.2%) -2ms .. 3ms
render10000Items1 2,704ms 2,616ms -31ms (-1.1%) -176ms .. 20ms
clearManyItems1 362ms 360ms 2ms (+0.5%) -5ms .. 6ms
render10000Items2 2,590ms 2,553ms -35ms (-1.4%) -126ms .. 13ms
clearManyItems2 252ms 253ms 0ms (-0.1%) -7ms .. 8ms
render1000Items3 238ms 232ms 0ms (+0.2%) -11ms .. 10ms
append1000Items1 336ms 337ms -1ms (-0.3%) -27ms .. 31ms
append1000Items2 320ms 304ms -8ms (-2.6%) -48ms .. 9ms
updateEvery10thItem1 269ms 272ms -3ms (-1.0%) -15ms .. 6ms
updateEvery10thItem2 294ms 290ms -4ms (-1.3%) -18ms .. 9ms
selectFirstRow1 80ms 72ms -3ms (-4.3%) -10ms .. 1ms
selectSecondRow1 54ms 56ms 1ms (+2.7%) -2ms .. 6ms
removeFirstRow1 183ms 182ms -1ms (-0.8%) -8ms .. 7ms
removeSecondRow1 170ms 174ms 1ms (+0.4%) -7ms .. 7ms
swapRows1 114ms 117ms 0ms (-0.1%) -6ms .. 6ms
swapRows2 114ms 113ms -1ms (-0.8%) -7ms .. 3ms
clearItems4 103ms 101ms -2ms (-1.6%) -4ms .. 1ms
paint 6ms 9ms 0ms (+7.3%) -1ms .. 4ms

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