Swift VS Wasm benchmarks

Current benchmark data was generated on Fri Sep 30 2022, 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 2936ms 31ms 5.3MB 2920ms 0ms swift 5.7.0
wasm 1.rs timeout 0.0ms 0.0MB 0ms 0ms node 16.17.0
wasm 1.rs timeout 0.0ms 0.0MB 0ms 0ms wasmedgec 0.11.0
wasm 1.rs timeout 0.0ms 0.0MB 0ms 0ms wasmer/llvm 2.3.0
wasm 1.rs timeout 0.0ms 0.0MB 0ms 0ms wasmtime 1.0.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 245ms 0.7ms 5.0MB 230ms 0ms swift 5.7.0
wasm 1.rs 426ms 0.4ms 4.7MB 413ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 436ms 3.4ms 9.2MB 423ms 0ms wasmtime 1.0.1
wasm 1.rs 455ms 1.0ms 18.5MB 440ms 0ms wasmedgec 0.11.0
wasm 1.rs 499ms 6.0ms 44.2MB 503ms 7ms node 16.17.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 296ms 1.0ms 6.0MB 280ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 304ms 0.4ms 18.6MB 290ms 0ms wasmedgec 0.11.0
swift 3-m.swift 312ms 5.4ms 22.9MB 553ms 7ms swift 5.7.0
wasm 1.rs 317ms 0.2ms 9.4MB 300ms 0ms wasmtime 1.0.1
wasm 1.rs 415ms 2.8ms 43.8MB 423ms 7ms node 16.17.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 33ms 0.9ms 6.1MB 23ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 39ms 0.9ms 11.5MB 30ms 0ms wasmtime 1.0.1
wasm 1.rs 41ms 0.3ms 18.9MB 23ms 3ms wasmedgec 0.11.0
swift 3.swift 60ms 19ms 14.7MB 47ms 3ms swift 5.7.0
wasm 1.rs 123ms 0.8ms 43.3MB 137ms 7ms node 16.17.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 2.2ms 0.8ms 2.4MB 0ms 0ms swift 5.7.0
wasm 1.rs 2.5ms 0.2ms 4.9MB 0ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 6.6ms 1.7ms 9.2MB 0ms 0ms wasmtime 1.0.1
wasm 1.rs 8.6ms 1.2ms 18.4MB 0ms 0ms wasmedgec 0.11.0
wasm 1.rs 83ms 0.6ms 43.2MB 98ms 2ms node 16.17.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 2016ms 27ms 44.3MB 3780ms 23ms swift 5.7.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 339ms 1.6ms 33.3MB 573ms 13ms swift 5.7.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 449ms 0.8ms 5.0MB 440ms 0ms swift 5.7.0
wasm 1.rs 524ms 0.2ms 4.7MB 510ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 569ms 0.5ms 11.4MB 557ms 0ms wasmtime 1.0.1
wasm 1.rs 603ms 1.4ms 18.5MB 587ms 0ms wasmedgec 0.11.0
wasm 1.rs 660ms 2.0ms 48.5MB 680ms 10ms node 16.17.0
wasm 2.rs 802ms 0.2ms 18.7MB 783ms 0ms wasmedgec 0.11.0
wasm 2.rs 825ms 0.7ms 4.8MB 813ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 831ms 5.3ms 9.4MB 820ms 0ms wasmtime 1.0.1
wasm 2.rs 897ms 2.2ms 48.3MB 913ms 10ms node 16.17.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 49ms 1.5ms 5.0MB 40ms 0ms swift 5.7.0
wasm 1.rs 58ms 0.3ms 4.9MB 50ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 65ms 0.5ms 11.4MB 53ms 0ms wasmtime 1.0.1
wasm 1.rs 69ms 1.5ms 18.6MB 57ms 0ms wasmedgec 0.11.0
wasm 2.rs 85ms 1.6ms 4.9MB 73ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 89ms 1.7ms 18.5MB 77ms 0ms wasmedgec 0.11.0
wasm 2.rs 91ms 1.5ms 9.4MB 77ms 0ms wasmtime 1.0.1
wasm 1.rs 159ms 1.9ms 48.3MB 183ms 7ms node 16.17.0
wasm 2.rs 184ms 6.9ms 48.5MB 203ms 7ms node 16.17.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 2632ms 0.5ms 6.7MB 2623ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 2839ms 7.1ms 19.9MB 2827ms 3ms wasmedgec 0.11.0
wasm 2.rs 3093ms 4.6ms 11.4MB 3080ms 0ms wasmtime 1.0.1
wasm 2.rs 3345ms 2.3ms 49.3MB 3390ms 7ms node 16.17.0
swift 1.swift timeout 0.0ms 0.0MB 0ms 0ms swift 5.7.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 624ms 1.2ms 6.3MB 610ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 678ms 1.8ms 19.3MB 660ms 3ms wasmedgec 0.11.0
wasm 2.rs 737ms 0.8ms 11.7MB 717ms 3ms wasmtime 1.0.1
wasm 2.rs 889ms 0.7ms 48.8MB 930ms 3ms node 16.17.0
swift 1.swift 2755ms 11ms 6.7MB 2727ms 3ms swift 5.7.0