Elixir VS C 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

Input: 100000

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

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 1.c 1.8ms 0.7ms 0.9MB 0ms 0ms gcc 12.1.0
c 1.c 2.2ms 0.7ms 1.1MB 0ms 0ms clang 11.0.0
c 1.c 2.9ms 1.6ms 0.6MB 0ms 0ms zigcc 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

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

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 4-m.c 1271ms 6.7ms 1.0MB 2483ms 0ms gcc 12.1.0
c 6-im.c 1437ms 4.1ms 3.1MB 2810ms 3ms clang 11.0.0
c 6-im.c 1518ms 1.7ms 0.9MB 2970ms 0ms gcc 12.1.0
c 4-m.c 1537ms 7.1ms 3.0MB 3007ms 3ms clang 11.0.0
c 5-im.c 1582ms 3.4ms 1.0MB 3097ms 0ms gcc 12.1.0
c 5-im.c 1742ms 4.8ms 3.1MB 3407ms 0ms clang 11.0.0
c 3-m.c 1874ms 2.0ms 0.9MB 3670ms 3ms gcc 12.1.0
c 3-m.c 1889ms 6.2ms 3.0MB 3700ms 0ms clang 11.0.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
c 4-m.c 329ms 6.5ms 2.4MB 620ms 0ms gcc 12.1.0
c 6-im.c 372ms 3.6ms 3.1MB 703ms 0ms clang 11.0.0
c 4-m.c 395ms 2.9ms 2.9MB 757ms 0ms clang 11.0.0
c 6-im.c 401ms 15ms 0.9MB 747ms 0ms gcc 12.1.0
c 5-im.c 411ms 1.9ms 1.0MB 787ms 0ms gcc 12.1.0
c 5-im.c 453ms 15ms 3.1MB 857ms 0ms clang 11.0.0
c 3-m.c 484ms 2.2ms 1.0MB 920ms 0ms gcc 12.1.0
c 3-m.c 488ms 12ms 3.1MB 927ms 0ms clang 11.0.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
c 4-m.c 90ms 0.5ms 1.0MB 160ms 0ms gcc 12.1.0
c 6-im.c 101ms 1.2ms 2.9MB 180ms 0ms clang 11.0.0
c 6-im.c 105ms 0.8ms 1.0MB 190ms 0ms gcc 12.1.0
c 4-m.c 107ms 0.4ms 3.0MB 190ms 0ms clang 11.0.0
c 5-im.c 111ms 0.5ms 1.0MB 200ms 0ms gcc 12.1.0
c 5-im.c 128ms 9.1ms 2.9MB 220ms 0ms clang 11.0.0
c 3-m.c 130ms 1.0ms 0.9MB 233ms 0ms gcc 12.1.0
c 3-m.c 132ms 4.3ms 3.1MB 230ms 0ms clang 11.0.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 12.3.2