Wasm VS Python benchmarks

Current benchmark data was generated on Sat Mar 29 2025, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1)

* -m in a file name stands for multi-threading or multi-processing

* -i in a file name stands for direct intrinsics usage. (Usage of simd intrinsics via libraries is not counted)

* -ffi in a file name stands for non-stdlib FFI usage

* (You may find time < time(user) + time(sys) for some non-parallelized programs, the overhead is from GC or JIT compiler, which are allowed to take advantage of multi-cores as that's more close to real-world scenarios.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 1186ms 0.8ms 96.2MB 1120ms 50ms pypy 3.10.16
wasm 5.rs 1813ms 71ms 33.1MB 1793ms 7ms wasmtime 31.0.0
wasm 3.rs 1852ms 15ms 49.3MB 1827ms 13ms wasmtime 31.0.0
wasm 4.rs 1860ms 23ms 33.3MB 1840ms 10ms wasmtime 31.0.0
python 1.py timeout 0.0ms 40.8MB 4970ms 17ms cpython 3.13.2
python 1.py timeout 0.0ms 40.6MB 4760ms 220ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 98ms 2.9ms 68.8MB 70ms 13ms pypy 3.10.16
wasm 5.rs 171ms 3.6ms 19.2MB 160ms 0ms wasmtime 31.0.0
wasm 4.rs 180ms 2.7ms 19.1MB 167ms 0ms wasmtime 31.0.0
wasm 3.rs 180ms 4.1ms 21.1MB 167ms 0ms wasmtime 31.0.0
python 1.py 484ms 4.4ms 11.9MB 460ms 10ms pyston 3.8.12
python 1.py 745ms 25ms 12.6MB 737ms 0ms cpython 3.13.2

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 1134ms 3.5ms 19.4MB 1117ms 0ms wasmtime 31.0.0
python 1.py 1218ms 8.4ms 107.6MB 1167ms 40ms pypy 3.10.16
python 1.py 2748ms 76ms 25.1MB 2727ms 7ms cpython 3.13.2
python 1.py timeout 0.0ms 17.3MB 4980ms 10ms pyston 3.8.12

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 80ms 1.6ms 18.0MB 70ms 0ms wasmtime 31.0.0
python 1.py 222ms 2.1ms 86.9MB 187ms 17ms pypy 3.10.16
python 1.py 239ms 4.5ms 20.4MB 223ms 3ms cpython 3.13.2
python 1.py 657ms 9.5ms 16.8MB 640ms 7ms pyston 3.8.12

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 252ms 1.3ms 83.6MB 217ms 23ms pypy 3.10.16
python 1.py 362ms 3.6ms 12.6MB 343ms 0ms cpython 3.13.2
wasm 1.rs 417ms 2.9ms 18.6MB 403ms 0ms wasmtime 31.0.0
python 1.py 2008ms 3.3ms 9.6MB 1993ms 0ms pyston 3.8.12

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 101ms 2.1ms 63.3MB 73ms 10ms pypy 3.10.16
python 1.py 110ms 2.5ms 11.6MB 97ms 0ms cpython 3.13.2
wasm 1.rs 115ms 2.0ms 17.9MB 100ms 0ms wasmtime 31.0.0
python 1.py 351ms 2.5ms 8.9MB 340ms 0ms pyston 3.8.12

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 4164ms 21ms 16.8MB 4147ms 0ms wasmtime 31.0.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 348ms 2.4ms 17.4MB 337ms 0ms wasmtime 31.0.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 236ms 1.4ms 17.3MB 217ms 3ms wasmtime 31.0.0
python 1.py 1871ms 16ms 88.8MB 1820ms 37ms pypy 3.10.16
python 5-m.py 2286ms 25ms 65.4MB 3523ms 857ms pypy 3.10.16
python 5-m.py 2628ms 276ms 12.5MB 3513ms 1170ms pyston 3.8.12
python 1.py 3017ms 11ms 8.1MB 3000ms 0ms pyston 3.8.12
python 5-m.py 3415ms 25ms 13.6MB 4547ms 940ms cpython 3.13.2
python 1.py 4761ms 15ms 8.8MB 4747ms 0ms cpython 3.13.2

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 32ms 0.4ms 17.6MB 20ms 0ms wasmtime 31.0.0
python 1.py 253ms 1.6ms 63.4MB 220ms 20ms pypy 3.10.16
python 1.py 314ms 5.5ms 8.1MB 303ms 0ms pyston 3.8.12
python 5-m.py 336ms 9.5ms 12.5MB 440ms 160ms pyston 3.8.12
python 5-m.py 404ms 2.2ms 13.5MB 487ms 137ms cpython 3.13.2
python 5-m.py 447ms 0.8ms 65.4MB 747ms 307ms pypy 3.10.16
python 1.py 490ms 12ms 8.8MB 477ms 0ms cpython 3.13.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 6.7ms 0.5ms 17.2MB 0ms 0ms wasmtime 31.0.0
python 1.py 11ms 0.6ms 7.6MB 0ms 0ms pyston 3.8.12
python 1.py 14ms 1.2ms 8.6MB 10ms 0ms cpython 3.13.2
python 1.py 29ms 0.5ms 51.6MB 8ms 10ms pypy 3.10.16

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 89ms 0.8ms 17.3MB 80ms 0ms wasmtime 31.0.0
python 2.py 146ms 1.8ms 58.3MB 120ms 10ms pypy 3.10.16
python 1.py 181ms 2.9ms 59.3MB 153ms 13ms pypy 3.10.16
python 1.py 726ms 9.4ms 8.9MB 713ms 0ms pyston 3.8.12
python 2.py 831ms 7.8ms 8.5MB 817ms 0ms pyston 3.8.12
python 1.py 1180ms 49ms 9.3MB 1170ms 0ms cpython 3.13.2
python 2.py 1336ms 19ms 9.0MB 1323ms 0ms cpython 3.13.2

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 250ms 1.4ms 16.9MB 237ms 0ms wasmtime 31.0.0
python 2.py 342ms 5.4ms 59.2MB 313ms 10ms pypy 3.10.16
python 1.py 379ms 2.8ms 60.3MB 350ms 13ms pypy 3.10.16
python 1.py 2144ms 4.0ms 8.9MB 2130ms 0ms pyston 3.8.12
python 2.py 2479ms 16ms 8.5MB 2463ms 0ms pyston 3.8.12
python 1.py 3519ms 155ms 9.3MB 3507ms 0ms cpython 3.13.2
python 2.py 3929ms 97ms 9.0MB 3917ms 0ms cpython 3.13.2

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 48ms 1.8ms 17.4MB 40ms 0ms wasmtime 31.0.0
python 2.py 105ms 2.1ms 58.1MB 83ms 10ms pypy 3.10.16
python 1.py 122ms 3.8ms 58.7MB 97ms 10ms pypy 3.10.16
python 1.py 348ms 2.4ms 8.5MB 337ms 0ms pyston 3.8.12
python 2.py 387ms 3.3ms 8.1MB 373ms 0ms pyston 3.8.12
python 1.py 551ms 21ms 9.0MB 540ms 0ms cpython 3.13.2
python 2.py 640ms 9.1ms 8.8MB 627ms 0ms cpython 3.13.2

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 8.rs 821ms 2.1ms 20.2MB 810ms 0ms wasmtime 31.0.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 8.rs 43ms 1.1ms 17.4MB 30ms 0ms wasmtime 31.0.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 927ms 58ms 41.1MB 910ms 10ms wasmtime 31.0.0
python 1.py 2248ms 18ms 202.7MB 2120ms 107ms pypy 3.10.16
python 1.py timeout 0.0ms 93.9MB 4960ms 27ms cpython 3.13.2
python 1.py timeout 0.0ms 130.4MB 4937ms 43ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 197ms 2.3ms 23.3MB 180ms 0ms wasmtime 31.0.0
python 1.py 386ms 6.0ms 105.2MB 323ms 47ms pypy 3.10.16
python 1.py 3142ms 32ms 37.1MB 3113ms 13ms cpython 3.13.2
python 1.py timeout 0.0ms 48.8MB 4970ms 20ms pyston 3.8.12

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 411ms 2.4ms 17.1MB 400ms 0ms wasmtime 31.0.0
wasm 2.rs 583ms 2.8ms 17.0MB 570ms 0ms wasmtime 31.0.0
python 2.py 1361ms 7.5ms 57.9MB 1337ms 10ms pypy 3.10.16
python 1.py 2657ms 16ms 57.2MB 2630ms 7ms pypy 3.10.16
python 1.py timeout 0.0ms 8.6MB 4990ms 0ms cpython 3.13.2
python 2.py timeout 0.0ms 8.8MB 4987ms 0ms cpython 3.13.2
python 1.py timeout 0.0ms 8.3MB 4990ms 0ms pyston 3.8.12
python 2.py timeout 0.0ms 8.1MB 4987ms 0ms pyston 3.8.12

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 49ms 0.6ms 17.0MB 40ms 0ms wasmtime 31.0.0
wasm 2.rs 66ms 1.3ms 17.2MB 53ms 0ms wasmtime 31.0.0
python 2.py 180ms 2.3ms 57.9MB 157ms 10ms pypy 3.10.16
python 1.py 303ms 3.6ms 57.1MB 277ms 10ms pypy 3.10.16
python 1.py 945ms 42ms 8.3MB 930ms 0ms pyston 3.8.12
python 2.py 1310ms 7.2ms 8.3MB 1297ms 0ms pyston 3.8.12
python 1.py 3278ms 579ms 8.6MB 3270ms 0ms cpython 3.13.2
python 2.py 3298ms 42ms 8.8MB 3287ms 0ms cpython 3.13.2

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 379ms 5.8ms 22.0MB 367ms 0ms wasmtime 31.0.0
wasm 1.rs 511ms 9.4ms 56.3MB 493ms 0ms wasmtime 31.0.0
python 1.py 2599ms 1.4ms 369.5MB 2530ms 57ms pypy 3.10.16
python 2.py 3039ms 28ms 633.0MB 2870ms 157ms pyston 3.8.12
python 1.py 4752ms 17ms 320.4MB 4690ms 47ms pyston 3.8.12
python 1.py timeout 0.0ms 321.1MB 4957ms 27ms cpython 3.13.2
python 2.py timeout 0.0ms 633.6MB 4830ms 153ms cpython 3.13.2
python 2.py timeout 0.0ms 959.9MB 4710ms 273ms pypy 3.10.16

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 96ms 2.9ms 27.1MB 83ms 0ms wasmtime 31.0.0
wasm 2.rs 98ms 0.4ms 18.3MB 90ms 0ms wasmtime 31.0.0
python 1.py 540ms 8.7ms 135.2MB 507ms 20ms pypy 3.10.16
python 2.py 769ms 37ms 164.2MB 727ms 30ms pyston 3.8.12
python 1.py 1094ms 28ms 86.0MB 1070ms 7ms pyston 3.8.12
python 2.py 1513ms 103ms 164.8MB 1477ms 23ms cpython 3.13.2
python 2.py 1536ms 8.6ms 290.2MB 1450ms 70ms pypy 3.10.16
python 1.py 2723ms 5.6ms 86.8MB 2700ms 10ms cpython 3.13.2

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 4.py 1916ms 3.0ms 8.9MB 1873ms 30ms pyston 3.8.12
python 4.py 1946ms 3.1ms 9.3MB 1893ms 37ms cpython 3.13.2
python 4.py 2189ms 9.6ms 89.4MB 2150ms 27ms pypy 3.10.16
wasm 2.rs 2218ms 13ms 18.1MB 2207ms 0ms wasmtime 31.0.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 4.py 452ms 3.0ms 8.6MB 440ms 0ms pyston 3.8.12
python 4.py 465ms 2.7ms 9.1MB 453ms 0ms cpython 3.13.2
wasm 2.rs 524ms 3.2ms 17.3MB 510ms 0ms wasmtime 31.0.0
python 4.py 559ms 4.1ms 83.9MB 520ms 23ms pypy 3.10.16

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 3200ms 57ms 8.3MB 3193ms 0ms pyston 3.8.12
python 1.py 3539ms 28ms 74.3MB 3503ms 27ms pypy 3.10.16
wasm 1.rs 3616ms 7.7ms 16.8MB 3603ms 0ms wasmtime 31.0.0
python 1.py 3863ms 72ms 8.6MB 3847ms 0ms cpython 3.13.2

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 808ms 5.8ms 8.3MB 797ms 0ms pyston 3.8.12
wasm 1.rs 916ms 7.5ms 16.8MB 900ms 0ms wasmtime 31.0.0
python 1.py 990ms 9.8ms 8.6MB 980ms 0ms cpython 3.13.2
python 1.py 1000ms 9.6ms 67.3MB 973ms 17ms pypy 3.10.16

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 3601ms 3.0ms 16.9MB 3587ms 0ms wasmtime 31.0.0
wasm 7.rs 4896ms 5.3ms 16.9MB 4883ms 0ms wasmtime 31.0.0
python 8.py timeout 0.0ms 14.6MB 37ms 7ms cpython 3.13.2
python 8.py timeout 0.0ms 95.4MB 797ms 97ms pypy 3.10.16
python 8.py timeout 0.0ms 14.2MB 33ms 10ms pyston 3.8.12

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 910ms 5.9ms 17.4MB 897ms 0ms wasmtime 31.0.0
wasm 7.rs 1232ms 2.6ms 17.1MB 1220ms 0ms wasmtime 31.0.0
python 8.py timeout 0.0ms 14.5MB 53ms 13ms cpython 3.13.2
python 8.py timeout 0.0ms 96.1MB 1303ms 183ms pypy 3.10.16
python 8.py timeout 0.0ms 13.5MB 60ms 20ms pyston 3.8.12

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 236ms 2.5ms 16.7MB 223ms 0ms wasmtime 31.0.0
wasm 7.rs 315ms 1.2ms 17.2MB 300ms 0ms wasmtime 31.0.0
python 8-m.py 1980ms 4.3ms 93.0MB 6417ms 260ms pypy 3.10.16
python 8.py timeout 0.0ms 14.0MB 97ms 13ms cpython 3.13.2
python 8.py timeout 0.0ms 13.2MB 143ms 40ms pyston 3.8.12