Wasm VS Php benchmarks

Current benchmark data was generated on Thu May 04 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz (Model 85)

* -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
wasm 3.rs 2247ms 10ms 47.7MB 2220ms 13ms wasmedgec 0.12.0
wasm 5.rs 2270ms 20ms 31.4MB 2250ms 7ms wasmedgec 0.12.0
wasm 4.rs 2399ms 17ms 31.1MB 2377ms 7ms wasmedgec 0.12.0
wasm 5.rs 2729ms 16ms 64.3MB 2703ms 13ms node 18.16.0
wasm 5.rs 2794ms 29ms 31.5MB 2767ms 7ms wasmtime 8.0.1
wasm 3.rs 2829ms 27ms 47.5MB 2807ms 10ms wasmtime 8.0.1
wasm 4.rs 2851ms 30ms 64.2MB 2820ms 20ms node 18.16.0
wasm 3.rs 2897ms 22ms 80.3MB 2873ms 23ms node 18.16.0
wasm 4.rs 2989ms 34ms 31.5MB 2963ms 10ms wasmtime 8.0.1
php 1.php timeout 0.0ms 141.1MB 4937ms 47ms php 8.2.4

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 211ms 4.7ms 19.6MB 193ms 0ms wasmedgec 0.12.0
wasm 5.rs 213ms 2.7ms 17.4MB 197ms 0ms wasmedgec 0.12.0
wasm 4.rs 228ms 2.4ms 17.5MB 210ms 0ms wasmedgec 0.12.0
wasm 5.rs 273ms 5.7ms 17.3MB 260ms 0ms wasmtime 8.0.1
wasm 3.rs 280ms 21ms 19.4MB 247ms 3ms wasmtime 8.0.1
wasm 4.rs 288ms 8.4ms 17.3MB 267ms 0ms wasmtime 8.0.1
wasm 5.rs 302ms 0.8ms 51.2MB 287ms 10ms node 18.16.0
wasm 4.rs 312ms 5.2ms 51.6MB 293ms 17ms node 18.16.0
wasm 3.rs 314ms 2.5ms 51.9MB 300ms 10ms node 18.16.0
php 1.php 851ms 1.5ms 62.6MB 823ms 7ms php 8.2.4

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 1479ms 33ms 57.3MB 1477ms 23ms node 18.16.0
wasm 3.rs 1566ms 54ms 18.1MB 1537ms 0ms wasmtime 8.0.1
wasm 3.rs 2041ms 2.4ms 17.9MB 2023ms 0ms wasmedgec 0.12.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 105ms 1.9ms 16.3MB 90ms 0ms wasmtime 8.0.1
wasm 3.rs 139ms 1.4ms 16.1MB 127ms 0ms wasmedgec 0.12.0
wasm 3.rs 188ms 16ms 56.8MB 160ms 23ms node 18.16.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 462ms 1.8ms 16.9MB 443ms 0ms wasmedgec 0.12.0
wasm 1.rs 595ms 0.2ms 57.2MB 630ms 7ms node 18.16.0
wasm 1.rs 649ms 22ms 17.0MB 630ms 3ms wasmtime 8.0.1

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 125ms 1.5ms 16.4MB 117ms 0ms wasmedgec 0.12.0
wasm 1.rs 169ms 2.1ms 16.3MB 160ms 0ms wasmtime 8.0.1
wasm 1.rs 222ms 2.0ms 56.7MB 237ms 20ms node 18.16.0

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs timeout 0.0ms 49.3MB 4973ms 13ms node 18.16.0
wasm 1.rs timeout 0.0ms 15.4MB 4983ms 0ms wasmedgec 0.12.0
wasm 1.rs timeout 0.0ms 15.6MB 4983ms 0ms wasmtime 8.0.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 448ms 9.2ms 15.6MB 430ms 0ms wasmtime 8.0.1
wasm 1.rs 515ms 3.5ms 16.0MB 500ms 0ms wasmedgec 0.12.0
wasm 1.rs 796ms 4.0ms 48.9MB 780ms 10ms node 18.16.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 294ms 0.9ms 15.6MB 277ms 0ms wasmedgec 0.12.0
wasm 1.rs 457ms 0.5ms 49.5MB 440ms 10ms node 18.16.0
wasm 1.rs 466ms 7.4ms 15.4MB 450ms 0ms wasmtime 8.0.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 38ms 1.0ms 15.6MB 27ms 0ms wasmedgec 0.12.0
wasm 1.rs 57ms 4.5ms 15.6MB 47ms 0ms wasmtime 8.0.1
wasm 1.rs 94ms 3.1ms 49.2MB 77ms 3ms node 18.16.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 6.7ms 0.8ms 15.5MB 0ms 0ms wasmedgec 0.12.0
wasm 1.rs 9.7ms 1.3ms 15.7MB 0ms 0ms wasmtime 8.0.1
wasm 1.rs 50ms 1.9ms 47.3MB 32ms 8ms node 18.16.0
php 1.php 57ms 2.1ms 50.9MB 26ms 16ms php 8.2.4

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 160ms 2.1ms 15.6MB 147ms 0ms wasmedgec 0.12.0
wasm 1.rs 192ms 6.2ms 15.8MB 177ms 0ms wasmtime 8.0.1
wasm 1.rs 269ms 3.7ms 53.8MB 260ms 7ms node 18.16.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 459ms 1.8ms 15.2MB 440ms 0ms wasmedgec 0.12.0
wasm 1.rs 554ms 14ms 15.7MB 537ms 0ms wasmtime 8.0.1
wasm 1.rs 690ms 3.5ms 53.3MB 677ms 13ms node 18.16.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 82ms 0.5ms 15.4MB 70ms 0ms wasmedgec 0.12.0
wasm 1.rs 101ms 2.7ms 15.6MB 87ms 0ms wasmtime 8.0.1
wasm 1.rs 157ms 1.4ms 51.3MB 150ms 7ms node 18.16.0

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 8.rs 1069ms 7.8ms 18.5MB 1053ms 0ms wasmedgec 0.12.0
wasm 8.rs 1367ms 4.8ms 18.7MB 1353ms 0ms wasmtime 8.0.1
wasm 8.rs 1560ms 40ms 52.6MB 1547ms 7ms node 18.16.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 8.rs 53ms 0.1ms 15.5MB 40ms 0ms wasmedgec 0.12.0
wasm 8.rs 69ms 3.4ms 15.4MB 53ms 0ms wasmtime 8.0.1
wasm 8.rs 114ms 1.6ms 50.3MB 103ms 3ms node 18.16.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 1138ms 5.0ms 39.6MB 1117ms 10ms wasmedgec 0.12.0
wasm 1.rs 1361ms 19ms 39.6MB 1330ms 17ms wasmtime 8.0.1
wasm 1.rs 1379ms 6.0ms 73.8MB 1357ms 20ms node 18.16.0
php 1.php timeout 0.0ms 113.2MB 4950ms 30ms php 8.2.4

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 246ms 0.3ms 21.3MB 230ms 0ms wasmedgec 0.12.0
wasm 1.rs 289ms 3.1ms 21.6MB 270ms 3ms wasmtime 8.0.1
wasm 1.rs 341ms 1.4ms 57.2MB 323ms 7ms node 18.16.0
php 1.php 1214ms 6.9ms 66.4MB 1183ms 13ms php 8.2.4

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 581ms 0.6ms 17.4MB 567ms 0ms wasmedgec 0.12.0
wasm 1.rs 589ms 12ms 15.5MB 570ms 0ms wasmtime 8.0.1
wasm 1.rs 779ms 2.9ms 48.9MB 763ms 10ms node 18.16.0
wasm 2.rs 810ms 1.0ms 15.9MB 793ms 0ms wasmedgec 0.12.0
wasm 2.rs 857ms 32ms 15.6MB 840ms 0ms wasmtime 8.0.1
wasm 2.rs 1099ms 9.1ms 50.0MB 1083ms 7ms node 18.16.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 66ms 1.8ms 15.8MB 50ms 0ms wasmedgec 0.12.0
wasm 1.rs 70ms 3.0ms 15.6MB 60ms 0ms wasmtime 8.0.1
wasm 2.rs 89ms 1.0ms 15.7MB 80ms 0ms wasmedgec 0.12.0
wasm 2.rs 102ms 8.0ms 15.6MB 87ms 0ms wasmtime 8.0.1
wasm 1.rs 131ms 6.2ms 47.7MB 113ms 10ms node 18.16.0
wasm 2.rs 159ms 3.3ms 50.1MB 137ms 13ms node 18.16.0

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 583ms 2.3ms 20.4MB 570ms 0ms wasmedgec 0.12.0
wasm 2.rs 820ms 0.7ms 20.5MB 807ms 0ms wasmtime 8.0.1
wasm 1.rs 1189ms 31ms 54.6MB 1160ms 13ms wasmedgec 0.12.0
wasm 2.rs 1312ms 3.0ms 53.5MB 1297ms 3ms node 18.16.0
wasm 1.rs 2056ms 38ms 54.7MB 2037ms 10ms wasmtime 8.0.1
wasm 1.rs 2179ms 47ms 88.3MB 2147ms 27ms node 18.16.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 135ms 1.5ms 18.6MB 120ms 0ms wasmedgec 0.12.0
wasm 1.rs 152ms 1.4ms 25.4MB 140ms 0ms wasmedgec 0.12.0
wasm 1.rs 203ms 7.7ms 25.5MB 183ms 0ms wasmtime 8.0.1
wasm 2.rs 210ms 9.7ms 16.7MB 197ms 0ms wasmtime 8.0.1
wasm 2.rs 352ms 3.1ms 50.4MB 337ms 0ms node 18.16.0
wasm 1.rs 372ms 3.4ms 58.4MB 347ms 13ms node 18.16.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 2446ms 4.6ms 16.4MB 2430ms 0ms wasmedgec 0.12.0
wasm 2.rs 2981ms 0.3ms 54.0MB 2987ms 10ms node 18.16.0
wasm 2.rs 3340ms 0.9ms 16.7MB 3323ms 0ms wasmtime 8.0.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 584ms 5.6ms 16.3MB 573ms 0ms wasmedgec 0.12.0
wasm 2.rs 755ms 3.9ms 54.2MB 760ms 10ms node 18.16.0
wasm 2.rs 790ms 1.4ms 16.3MB 773ms 0ms wasmtime 8.0.1

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 4154ms 3.8ms 15.7MB 4140ms 0ms wasmedgec 0.12.0
wasm 1.rs 4399ms 20ms 59.5MB 4443ms 13ms node 18.16.0
wasm 1.rs 4925ms 25ms 15.7MB 4907ms 0ms wasmtime 8.0.1

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 1045ms 1.8ms 15.9MB 1027ms 0ms wasmedgec 0.12.0
wasm 1.rs 1166ms 7.7ms 61.2MB 1203ms 17ms node 18.16.0
wasm 1.rs 1238ms 5.4ms 15.6MB 1220ms 3ms wasmtime 8.0.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 3441ms 0.7ms 16.1MB 3420ms 0ms wasmedgec 0.12.0
wasm 7.rs 3667ms 21ms 16.2MB 3650ms 0ms wasmedgec 0.12.0
wasm 2.rs 3814ms 3.2ms 15.5MB 3797ms 0ms wasmtime 8.0.1
wasm 7.rs 4365ms 35ms 48.9MB 4347ms 7ms node 18.16.0
wasm 2.rs 4483ms 1.7ms 48.8MB 4463ms 7ms node 18.16.0
wasm 7.rs timeout 0.0ms 15.6MB 4980ms 0ms wasmtime 8.0.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 868ms 0.6ms 16.1MB 850ms 0ms wasmedgec 0.12.0
wasm 7.rs 918ms 0.3ms 16.0MB 903ms 0ms wasmedgec 0.12.0
wasm 2.rs 1018ms 0.2ms 15.6MB 1000ms 0ms wasmtime 8.0.1
wasm 7.rs 1138ms 2.2ms 48.9MB 1123ms 7ms node 18.16.0
wasm 2.rs 1158ms 0.9ms 48.5MB 1140ms 7ms node 18.16.0
wasm 7.rs 3224ms 1.1ms 15.6MB 3213ms 0ms wasmtime 8.0.1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 224ms 0.8ms 15.8MB 213ms 0ms wasmedgec 0.12.0
wasm 7.rs 239ms 4.3ms 15.8MB 220ms 0ms wasmedgec 0.12.0
wasm 2.rs 263ms 1.6ms 15.5MB 247ms 0ms wasmtime 8.0.1
wasm 7.rs 323ms 2.1ms 47.7MB 307ms 3ms node 18.16.0
wasm 2.rs 329ms 0.3ms 48.6MB 310ms 3ms node 18.16.0
wasm 7.rs 816ms 3.0ms 15.6MB 800ms 0ms wasmtime 8.0.1