Elixir VS Zig benchmarks

Current benchmark data was generated on Wed May 25 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.)

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 12.3.2

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
elixir 1.ex 520ms 11ms 48.2MB 520ms 67ms elixir 12.3.2

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 12.3.2
zig 1.zig timeout 0.0ms 0.0MB 0ms 0ms zig 0.10.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 907ms 1.0ms 0.5MB 813ms 77ms zig 0.10.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 12.3.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 1.8ms 0.8ms 0.1MB 0ms 0ms zig 0.10.0
elixir 1.ex 225ms 3.7ms 49.0MB 226ms 44ms elixir 12.3.2

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 12.3.2
zig 1.zig timeout 0.0ms 0.0MB 0ms 0ms zig 0.10.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
elixir 1.ex 1181ms 4.3ms 48.1MB 1160ms 153ms elixir 12.3.2
zig 1.zig 2845ms 10ms 0.4MB 1060ms 1770ms zig 0.10.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2-m.zig 893ms 1.7ms 0.3MB 1660ms 0ms zig 0.10.0
zig 2.zig 1660ms 114ms 0.0MB 1650ms 0ms zig 0.10.0
zig 1.zig 3381ms 16ms 0.1MB 3370ms 0ms zig 0.10.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 12.3.2

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2-m.zig 230ms 1.2ms 0.2MB 410ms 0ms zig 0.10.0
zig 2.zig 420ms 28ms 0.0MB 413ms 0ms zig 0.10.0
zig 1.zig 850ms 1.6ms 0.1MB 840ms 0ms zig 0.10.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 12.3.2

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 2-m.zig 65ms 2.2ms 0.2MB 93ms 0ms zig 0.10.0
zig 2.zig 100ms 0.4ms 0.0MB 90ms 0ms zig 0.10.0
zig 1.zig 226ms 22ms 0.1MB 213ms 0ms zig 0.10.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 12.3.2