Stream: git-wasmtime

Topic: wasmtime / issue #15210 Performance regression in 4182eba...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2026 at 22:13):

ba-are-we-fast-yet[bot] opened issue #15210:

are-we-fast-yet found 4 regressions and 9 speedups in virtual cycles (callgrind) between Wasmtime 4182ebadb18e and 5619a5dab7b1.

A change counts when a Mann-Whitney U test finds it significant at the 0.01 level and it clears its phase's minimum relative change:

phase geomean individual
compilation 0.3% 1%
instantiation 2.5% 20%
execution 0.5% 2%

Regressions (4)

benchmark phase Δ virtual cycles virtual cycles noise Δ instructions retired instructions retired noise
libsodium/libsodium-hash3.wasm execution +4.91% (+4.84% to +4.98%) 0.065% -> 0.073% +4.97% 0.012% -> 0.013%
kotlin-richards/kotlin-richards.wasm execution +2.98% (+2.97% to +3.50%) 0.500% -> 0.011% -0.19% 0.001% -> 0.002%
libsodium/libsodium-keygen.wasm execution +2.43% (+2.35% to +2.54%) 0.119% -> 0.120% +2.54% 0.115% -> 0.063%
gcc-loops/benchmark.wasm execution +2.30% (+2.23% to +2.37%) 0.070% -> 0.072% +2.36% 0.011% -> 0.014%

Speedups (9)

benchmark phase Δ virtual cycles virtual cycles noise Δ instructions retired instructions retired noise
Geomean execution -11.57% (-11.64% to -11.50%) n/a n/a n/a
Geomean compilation -0.56% (-0.57% to -0.55%) n/a n/a n/a
splay/splay.wasm execution -96.21% (-96.21% to -96.21%) 0.000% -> 0.003% -96.51% 0.000% -> 0.001%
ocaml-raytrace/ocaml-raytrace.wasm execution -18.59% (-18.60% to -18.58%) 0.020% -> 0.009% -15.71% 0.003% -> 0.002%
dart-deltablue/dart-deltablue.wasm execution -16.33% (-16.34% to -16.32%) 0.009% -> 0.008% -16.14% 0.002% -> 0.002%
hoot-earley-boyer/hoot-earley-boyer.wasm compilation -9.49% (-9.53% to -9.47%) 0.050% -> 0.030% -12.59% 0.009% -> 0.009%
shootout/shootout-switch.wasm compilation -6.26% (-6.36% to -6.02%) 0.255% -> 0.112% -7.18% 0.065% -> 0.062%
tinygo/tinygo-regex.wasm execution -2.95% (-2.96% to -2.93%) 0.005% -> 0.022% +1.72% 0.002% -> 0.004%
tinygo/tinygo-regex.wasm compilation -1.56% (-1.69% to -1.53%) 0.132% -> 0.031% -1.86% 0.007% -> 0.033%

A positive delta is a slowdown, a negative delta is a speedup.

instructions retired counts work done rather than how well it was predicted. A regression whose instructions didn't move is often Valgrind's branch predictors aliasing on a code layout change; see docs/regressions.md.

Each noise column is how far that event's own counts spread.

<details>
<summary>Other callgrind counters that changed for these benchmarks</summary>

benchmark phase counter Δ noise
kotlin-richards/kotlin-richards.wasm execution conditional-branch-misses +28.39% (+28.38% to +34.44%) 4.505% -> 0.003%
libsodium/libsodium-hash3.wasm execution indirect-branch-misses -21.40% (-28.48% to -10.07%) 7.358% -> 22.414%
libsodium/libsodium-hash3.wasm execution ll-dcache-read-misses +11.76% (+8.57% to +17.65%) 5.714% -> 5.195%
libsodium/libsodium-hash3.wasm execution instructions-retired +4.97% (+4.96% to +4.98%) 0.012% -> 0.013%
libsodium/libsodium-keygen.wasm execution instructions-retired +2.54% (+2.47% to +2.61%) 0.115% -> 0.063%
gcc-loops/benchmark.wasm execution instructions-retired +2.36% (+2.35% to +2.37%) 0.011% -> 0.014%

</details>

Commits

https://github.com/bytecodealliance/wasmtime/compare/4182ebadb18e5655c246a0e67e53b3213bcaa3cf...5619a5dab7b17c397d349570edf29373d1a7b279

Reproduce locally

On x86-64 Linux with Valgrind installed:

git clone https://github.com/bytecodealliance/sightglass
cd sightglass
git checkout 2d453335318d05cf42b6f3263aa68f0021985f10
rustc engines/wasmtime/build.rs -o build-engine
mkdir old new
REVISION=4182ebadb18e5655c246a0e67e53b3213bcaa3cf ./build-engine old
REVISION=5619a5dab7b17c397d349570edf29373d1a7b279 ./build-engine new
cargo run --release -- benchmark --measure callgrind \
  --engine old/libengine.so --engine new/libengine.so \
  --engine-flags-common="-Cparallel-compilation=n --target x86_64-unknown-linux-gnu -Ccranelift-has-sse3 -Ccranelift-has-ssse3 -Ccranelift-has-sse41 -Ccranelift-has-sse42 -Ccranelift-has-popcnt -Ccranelift-has-avx -Ccranelift-has-avx2 -Ccranelift-has-fma -Ccranelift-has-bmi1 -Ccranelift-has-bmi2 -Ccranelift-has-lzcnt -Ccranelift-has-cmpxchg16b" \
  -- benchmarks/gcc-loops/benchmark.wasm benchmarks/kotlin-richards/kotlin-richards.wasm benchmarks/libsodium/libsodium-hash3.wasm benchmarks/libsodium/libsodium-keygen.wasm

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2026 at 22:13):

ba-are-we-fast-yet[bot] added the performance label to Issue #15210.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2026 at 22:13):

ba-are-we-fast-yet[bot] added the awfy label to Issue #15210.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 15:16):

alexcrichton commented on issue #15210:

My guess is #15207 is probably the 96% (!!) reduction in cycles and other improvements in GC benchmarks.

It then also seems that #15205 is likely the cause of the other execution slowdowns. cc @cfallin as this seems like it might be counter your expectations on #15205?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 19:50):

cfallin commented on issue #15210:

Hmm, interesting. The contributor on #15205 ran "real" benchmark timings (cycles) and these showed smaller impact than the Callgrind virtual cycle counts here; gcc-loops was the only >1-2% regression in the original timings (and the original timings saw some decent speedups too, overall fairly positive). I think I'll go with the real-machine-measured stats on this one...

view this post on Zulip Wasmtime GitHub notifications bot (Nov 17 2026 at 19:34):

fitzgen commented on issue #15210:

@cfallin

Hmm, interesting. The contributor on #15205 ran "real" benchmark timings (cycles) and these showed smaller impact than the Callgrind virtual cycle counts here; gcc-loops was the only >1-2% regression in the original timings (and the original timings saw some decent speedups too, overall fairly positive). I think I'll go with the real-machine-measured stats on this one...

Do you mind double checking these benchmarks? If the regression is actually smaller in reality than callgrind's virtual cycles suggests, then we can go ahead and close this issue.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2026 at 00:08):

cfallin commented on issue #15210:

Yep, here's a comparison against a Sightglass run (default settings) before and after #15205, on my Ryzen 9950X (Zen 5):

  ┌──────────────────┬────────────────────────────┬──────────────────┬─────────────────────────────────────┐
  │    benchmark     │ Callgrind (from the issue) │ real cycles here │            significant?             │
  ├──────────────────┼────────────────────────────┼──────────────────┼─────────────────────────────────────┤
  │ libsodium-hash3  │ +4.91%                     │ +0.06%           │ no                                  │
  ├──────────────────┼────────────────────────────┼──────────────────┼─────────────────────────────────────┤
  │ kotlin-richards  │ +2.98%                     │ −0.42%           │ no                                  │
  ├──────────────────┼────────────────────────────┼──────────────────┼─────────────────────────────────────┤
  │ libsodium-keygen │ +2.43%                     │ −0.32%           │ no                                  │
  ├──────────────────┼────────────────────────────┼──────────────────┼─────────────────────────────────────┤
  │ gcc-loops        │ +2.30%                     │ +0.37%           │ no                                  │
  ├──────────────────┼────────────────────────────┼──────────────────┼─────────────────────────────────────┤
  │ dotnet-raytracer │ —                          │ −2.10%           │ yes: 1.02x–1.03x faster, p < 0.0001 │
  ├──────────────────┼────────────────────────────┼──────────────────┼─────────────────────────────────────┤
  │ Geomean (26)     │ —                          │ ~−0.3%           │ no difference                       │
  └──────────────────┴────────────────────────────┴──────────────────┴─────────────────────────────────────┘

so "no significant difference" or "very slightly faster", i.e., Callgrind's numbers aren't representative of (one instance of) real hardware. Will go ahead and close -- thanks for asking for the double-check.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2026 at 00:08):

cfallin closed issue #15210:

are-we-fast-yet found 4 regressions and 9 speedups in virtual cycles (callgrind) between Wasmtime 4182ebadb18e and 5619a5dab7b1.

A change counts when a Mann-Whitney U test finds it significant at the 0.01 level and it clears its phase's minimum relative change:

phase geomean individual
compilation 0.3% 1%
instantiation 2.5% 20%
execution 0.5% 2%

Regressions (4)

benchmark phase Δ virtual cycles virtual cycles noise Δ instructions retired instructions retired noise
libsodium/libsodium-hash3.wasm execution +4.91% (+4.84% to +4.98%) 0.065% -> 0.073% +4.97% 0.012% -> 0.013%
kotlin-richards/kotlin-richards.wasm execution +2.98% (+2.97% to +3.50%) 0.500% -> 0.011% -0.19% 0.001% -> 0.002%
libsodium/libsodium-keygen.wasm execution +2.43% (+2.35% to +2.54%) 0.119% -> 0.120% +2.54% 0.115% -> 0.063%
gcc-loops/benchmark.wasm execution +2.30% (+2.23% to +2.37%) 0.070% -> 0.072% +2.36% 0.011% -> 0.014%

Speedups (9)

benchmark phase Δ virtual cycles virtual cycles noise Δ instructions retired instructions retired noise
Geomean execution -11.57% (-11.64% to -11.50%) n/a n/a n/a
Geomean compilation -0.56% (-0.57% to -0.55%) n/a n/a n/a
splay/splay.wasm execution -96.21% (-96.21% to -96.21%) 0.000% -> 0.003% -96.51% 0.000% -> 0.001%
ocaml-raytrace/ocaml-raytrace.wasm execution -18.59% (-18.60% to -18.58%) 0.020% -> 0.009% -15.71% 0.003% -> 0.002%
dart-deltablue/dart-deltablue.wasm execution -16.33% (-16.34% to -16.32%) 0.009% -> 0.008% -16.14% 0.002% -> 0.002%
hoot-earley-boyer/hoot-earley-boyer.wasm compilation -9.49% (-9.53% to -9.47%) 0.050% -> 0.030% -12.59% 0.009% -> 0.009%
shootout/shootout-switch.wasm compilation -6.26% (-6.36% to -6.02%) 0.255% -> 0.112% -7.18% 0.065% -> 0.062%
tinygo/tinygo-regex.wasm execution -2.95% (-2.96% to -2.93%) 0.005% -> 0.022% +1.72% 0.002% -> 0.004%
tinygo/tinygo-regex.wasm compilation -1.56% (-1.69% to -1.53%) 0.132% -> 0.031% -1.86% 0.007% -> 0.033%

A positive delta is a slowdown, a negative delta is a speedup.

instructions retired counts work done rather than how well it was predicted. A regression whose instructions didn't move is often Valgrind's branch predictors aliasing on a code layout change; see docs/regressions.md.

Each noise column is how far that event's own counts spread.

<details>
<summary>Other callgrind counters that changed for these benchmarks</summary>

benchmark phase counter Δ noise
kotlin-richards/kotlin-richards.wasm execution conditional-branch-misses +28.39% (+28.38% to +34.44%) 4.505% -> 0.003%
libsodium/libsodium-hash3.wasm execution indirect-branch-misses -21.40% (-28.48% to -10.07%) 7.358% -> 22.414%
libsodium/libsodium-hash3.wasm execution ll-dcache-read-misses +11.76% (+8.57% to +17.65%) 5.714% -> 5.195%
libsodium/libsodium-hash3.wasm execution instructions-retired +4.97% (+4.96% to +4.98%) 0.012% -> 0.013%
libsodium/libsodium-keygen.wasm execution instructions-retired +2.54% (+2.47% to +2.61%) 0.115% -> 0.063%
gcc-loops/benchmark.wasm execution instructions-retired +2.36% (+2.35% to +2.37%) 0.011% -> 0.014%

</details>

Commits

https://github.com/bytecodealliance/wasmtime/compare/4182ebadb18e5655c246a0e67e53b3213bcaa3cf...5619a5dab7b17c397d349570edf29373d1a7b279

Reproduce locally

On x86-64 Linux with Valgrind installed:

git clone https://github.com/bytecodealliance/sightglass
cd sightglass
git checkout 2d453335318d05cf42b6f3263aa68f0021985f10
rustc engines/wasmtime/build.rs -o build-engine
mkdir old new
REVISION=4182ebadb18e5655c246a0e67e53b3213bcaa3cf ./build-engine old
REVISION=5619a5dab7b17c397d349570edf29373d1a7b279 ./build-engine new
cargo run --release -- benchmark --measure callgrind \
  --engine old/libengine.so --engine new/libengine.so \
  --engine-flags-common="-Cparallel-compilation=n --target x86_64-unknown-linux-gnu -Ccranelift-has-sse3 -Ccranelift-has-ssse3 -Ccranelift-has-sse41 -Ccranelift-has-sse42 -Ccranelift-has-popcnt -Ccranelift-has-avx -Ccranelift-has-avx2 -Ccranelift-has-fma -Ccranelift-has-bmi1 -Ccranelift-has-bmi2 -Ccranelift-has-lzcnt -Ccranelift-has-cmpxchg16b" \
  -- benchmarks/gcc-loops/benchmark.wasm benchmarks/kotlin-richards/kotlin-richards.wasm benchmarks/libsodium/libsodium-hash3.wasm benchmarks/libsodium/libsodium-keygen.wasm

Last updated: Nov 19 2026 at 20:05 UTC