Stream: cranelift

Topic: recent speed ups to bounds checking


view this post on Zulip fitzgen (he/him) (Jan 06 2023 at 21:12):

TLDR: 13-29% faster on our benchmarks than before! However, still about twice as slow as using virtual memory instead of explicit bounds checks, so lots of room for improvement still.

Bounds checks: before vs after my recent optimizations on main

execution :: instructions-retired :: benchmarks/bz2/benchmark.wasm

  Δ = 148204576.00 ± 10.02 (confidence = 99%)

  after.so is 1.29x to 1.29x faster than before.so!

  [506439156 506439166.50 506439171] after.so
  [654643734 654643742.50 654643758] before.so

execution :: instructions-retired :: benchmarks/spidermonkey/benchmark.wasm

  Δ = 1281223342.90 ± 175070.53 (confidence = 99%)

  after.so is 1.22x to 1.22x faster than before.so!

  [5774522744 5774758625.80 5775025986] after.so
  [7055874820 7055981968.70 7056050049] before.so

execution :: instructions-retired :: benchmarks/pulldown-cmark/benchmark.wasm

  Δ = 5496151.40 ± 316.89 (confidence = 99%)

  after.so is 1.13x to 1.13x faster than before.so!

  [40910019 40910126.40 40910656] after.so
  [46406041 46406277.80 46406724] before.so

virtual memory vs bounds checks on main

execution :: instructions-retired :: benchmarks/spidermonkey/benchmark.wasm

  Δ = 2958026398.40 ± 107757.57 (confidence = 99%)

  virtual-memory.so is 2.05x to 2.05x faster than bounds-checks.so!

  [5774521205 5774605965.50 5774731779] bounds-checks.so
  [2816515568 2816579567.10 2816805446] virtual-memory.so

execution :: instructions-retired :: benchmarks/bz2/benchmark.wasm

  Δ = 244017813.00 ± 9.04 (confidence = 99%)

  virtual-memory.so is 1.93x to 1.93x faster than bounds-checks.so!

  [506439155 506439167.10 506439183] bounds-checks.so
  [262421349 262421354.10 262421360] virtual-memory.so

execution :: instructions-retired :: benchmarks/pulldown-cmark/benchmark.wasm

  Δ = 18640684.30 ± 437.03 (confidence = 99%)

  virtual-memory.so is 1.84x to 1.84x faster than bounds-checks.so!

  [40910026 40910343.40 40910857] bounds-checks.so
  [22269208 22269659.10 22269936] virtual-memory.so

view this post on Zulip fitzgen (he/him) (Jan 06 2023 at 21:15):

also, thanks to @Alex Crichton for digging into these benchmarks with me


Last updated: Dec 23 2024 at 12:05 UTC