Elixir VS Rust benchmarks

Current benchmark data was generated on Thu Sep 22 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -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.)

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5-m.rs 915ms 116ms 5.2MB 1747ms 30ms rustc 1.64.0
rust 3-m.rs 935ms 70ms 6.3MB 1773ms 27ms rustc 1.64.0
rust 3.rs 1829ms 16ms 6.5MB 1780ms 30ms rustc 1.64.0
rust 1-m.rs 2570ms 16ms 5.2MB 4930ms 123ms rustc 1.64.0
rust 4.rs 3185ms 4.4ms 4.4MB 3170ms 0ms rustc 1.64.0
elixir 1.ex 4743ms 26ms 53.5MB 4777ms 117ms elixir 13.1.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-m.rs 72ms 4.5ms 2.9MB 113ms 3ms rustc 1.64.0
rust 5-m.rs 93ms 16ms 3.0MB 153ms 7ms rustc 1.64.0
rust 3.rs 117ms 0.7ms 3.1MB 107ms 0ms rustc 1.64.0
rust 1-m.rs 192ms 1.5ms 2.9MB 327ms 27ms rustc 1.64.0
rust 4.rs 210ms 0.6ms 2.6MB 197ms 0ms rustc 1.64.0
elixir 1.ex 509ms 4.1ms 50.6MB 543ms 43ms elixir 13.1.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 146ms 0.9ms 3.7MB 140ms 0ms rustc 1.64.0
rust 2.rs 599ms 0.4ms 4.1MB 587ms 0ms rustc 1.64.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 41ms 0.2ms 3.0MB 30ms 0ms rustc 1.64.0
rust 2.rs 114ms 1.3ms 3.3MB 100ms 0ms rustc 1.64.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 1.7ms 0.6ms 0.6MB 0ms 0ms rustc 1.66.0-nightly
rust 1.rs 1.7ms 0.6ms 0.6MB 0ms 0ms rustc 1.64.0
elixir 1.ex 216ms 4.1ms 47.8MB 240ms 34ms elixir 13.1.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 2.rs 1838ms 1.3ms 2.9MB 1770ms 50ms rustc 1.64.0
rust 1.rs 1854ms 1.9ms 2.8MB 1703ms 137ms rustc 1.64.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 395ms 3.1ms 2.5MB 373ms 7ms rustc 1.64.0
rust 2.rs 410ms 0.3ms 2.6MB 397ms 0ms rustc 1.64.0
elixir 1.ex 1308ms 3.9ms 46.6MB 1347ms 133ms elixir 13.1.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 1065ms 2.8ms 2.6MB 2060ms 0ms rustc 1.66.0-nightly
rust 7-m.rs 1066ms 4.5ms 2.2MB 2060ms 0ms rustc 1.64.0
rust 8.rs 2063ms 3.3ms 2.5MB 2050ms 0ms rustc 1.66.0-nightly
rust 7.rs 2065ms 5.3ms 2.0MB 2050ms 0ms rustc 1.64.0
rust 2-m.rs 2151ms 4.0ms 2.1MB 4187ms 0ms rustc 1.64.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0
rust 2.rs timeout 0.0ms 0.0MB 0ms 0ms rustc 1.64.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 7-m.rs 275ms 0.4ms 0.7MB 507ms 3ms rustc 1.64.0
rust 8-m.rs 277ms 2.7ms 2.4MB 510ms 0ms rustc 1.66.0-nightly
rust 7.rs 517ms 0.3ms 0.6MB 507ms 0ms rustc 1.64.0
rust 8.rs 518ms 0.1ms 2.2MB 510ms 0ms rustc 1.66.0-nightly
rust 2-m.rs 545ms 0.6ms 2.1MB 1040ms 0ms rustc 1.64.0
rust 2.rs 1707ms 1.1ms 0.6MB 1697ms 0ms rustc 1.64.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 7-m.rs 75ms 1.2ms 2.1MB 130ms 0ms rustc 1.64.0
rust 8-m.rs 77ms 3.5ms 2.2MB 123ms 0ms rustc 1.66.0-nightly
rust 8.rs 132ms 0.8ms 2.1MB 120ms 0ms rustc 1.66.0-nightly
rust 7.rs 132ms 0.8ms 0.6MB 120ms 0ms rustc 1.64.0
rust 2-m.rs 145ms 1.3ms 0.7MB 257ms 0ms rustc 1.64.0
rust 2.rs 429ms 0.2ms 0.6MB 420ms 0ms rustc 1.64.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0