Swift VS Wasm benchmarks

Current benchmark data was generated on Mon Feb 06 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.)

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 2924ms 4.7ms 2.4MB 2910ms 0ms swift 5.7.3
wasm 1.rs timeout 0.0ms 44.2MB 5007ms 3ms node 16.19.0
wasm 1.rs timeout 0.0ms 16.1MB 4983ms 0ms wasmedgec 0.11.2
wasm 1.rs timeout 0.0ms 9.2MB 4987ms 0ms wasmtime 5.0.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 245ms 1.3ms 2.4MB 230ms 0ms swift 5.7.3
wasm 1.rs 445ms 4.9ms 9.1MB 430ms 0ms wasmtime 5.0.0
wasm 1.rs 451ms 0.2ms 15.2MB 437ms 3ms wasmedgec 0.11.2
wasm 1.rs 499ms 1.2ms 43.8MB 490ms 20ms node 16.19.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 309ms 1.6ms 17.4MB 293ms 0ms wasmedgec 0.11.2
wasm 1.rs 349ms 1.3ms 9.3MB 340ms 0ms wasmtime 5.0.0
wasm 1.rs 386ms 5.1ms 43.8MB 393ms 13ms node 16.19.0
swift 3.swift 405ms 28ms 22.7MB 537ms 10ms swift 5.7.3

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 40ms 4.6ms 14.4MB 30ms 0ms wasmedgec 0.11.2
wasm 1.rs 42ms 1.0ms 9.3MB 27ms 0ms wasmtime 5.0.0
swift 3.swift 65ms 1.8ms 14.7MB 40ms 7ms swift 5.7.3
wasm 1.rs 119ms 1.5ms 43.8MB 123ms 13ms node 16.19.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 3.4ms 0.1ms 0.0MB 0ms 0ms swift 5.7.3
wasm 1.rs 5.9ms 0.8ms 11.2MB 0ms 0ms wasmtime 5.0.0
wasm 1.rs 6.8ms 0.7ms 15.9MB 0ms 0ms wasmedgec 0.11.2
wasm 1.rs 84ms 1.8ms 43.4MB 96ms 4ms node 16.19.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 2227ms 12ms 42.1MB 4180ms 30ms swift 5.7.3

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 393ms 32ms 33.6MB 630ms 17ms swift 5.7.3

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 453ms 6.5ms 5.2MB 443ms 0ms swift 5.7.3
wasm 1.rs 569ms 1.1ms 9.4MB 553ms 0ms wasmtime 5.0.0
wasm 1.rs 606ms 0.3ms 15.8MB 590ms 0ms wasmedgec 0.11.2
wasm 1.rs 660ms 3.1ms 48.1MB 677ms 7ms node 16.19.0
wasm 2.rs 802ms 3.5ms 11.2MB 787ms 0ms wasmtime 5.0.0
wasm 2.rs 836ms 4.9ms 15.4MB 820ms 0ms wasmedgec 0.11.2
wasm 2.rs 892ms 2.1ms 48.8MB 907ms 13ms node 16.19.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 49ms 2.8ms 5.2MB 40ms 0ms swift 5.7.3
wasm 1.rs 66ms 1.8ms 11.3MB 50ms 0ms wasmtime 5.0.0
wasm 1.rs 69ms 0.9ms 15.8MB 57ms 0ms wasmedgec 0.11.2
wasm 2.rs 90ms 1.2ms 11.3MB 77ms 0ms wasmtime 5.0.0
wasm 2.rs 91ms 0.3ms 15.5MB 80ms 0ms wasmedgec 0.11.2
wasm 1.rs 157ms 2.7ms 48.1MB 177ms 3ms node 16.19.0
wasm 2.rs 183ms 1.1ms 48.6MB 200ms 7ms node 16.19.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 2443ms 5.8ms 16.3MB 2430ms 0ms wasmedgec 0.11.2
wasm 2.rs 2805ms 1.3ms 11.7MB 2790ms 0ms wasmtime 5.0.0
wasm 2.rs 3077ms 4.9ms 48.2MB 3110ms 10ms node 16.19.0
swift 1.swift timeout 0.0ms 6.7MB 4970ms 10ms swift 5.7.3

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 580ms 1.2ms 16.8MB 567ms 3ms wasmedgec 0.11.2
wasm 2.rs 667ms 1.9ms 11.2MB 650ms 0ms wasmtime 5.0.0
wasm 2.rs 818ms 4.1ms 48.6MB 857ms 7ms node 16.19.0
swift 1.swift 2616ms 0.1ms 6.3MB 2600ms 3ms swift 5.7.3