Elixir VS Java benchmarks

Current benchmark data was generated on Mon Oct 03 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
java 1-m.java 3270ms 158ms 200.1MB 6133ms 83ms openjdk 19
java 1-m.java 4149ms 116ms 924.9MB 7387ms 497ms openjdk/zgc 19
elixir 1.ex 4662ms 52ms 53.9MB 4710ms 103ms elixir 13.1.0
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
elixir 1.ex 503ms 6.1ms 48.1MB 523ms 57ms elixir 13.1.0
java 1-m.java 733ms 72ms 115.5MB 1300ms 40ms openjdk 19
java 1-m.java 929ms 22ms 325.8MB 1493ms 193ms openjdk/zgc 19
java 1-m.java 953ms 129ms 116.0MB 1717ms 43ms openjdk 20

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 729ms 22ms 284.6MB 1260ms 83ms graal/jvm 17.0.4
java 1-m.java 826ms 72ms 201.4MB 1450ms 77ms openjdk 19
java 1-m.java 861ms 127ms 211.6MB 1540ms 53ms openjdk 20
java 1-m.java 1027ms 58ms 480.3MB 1547ms 323ms openjdk/zgc 19
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
java 1-m.java 407ms 5.7ms 186.4MB 680ms 40ms graal/jvm 17.0.4
java 1-m.java 441ms 28ms 116.2MB 733ms 37ms openjdk 19
java 1-m.java 455ms 35ms 117.1MB 757ms 43ms openjdk 20
java 1-m.java 539ms 17ms 209.0MB 790ms 133ms openjdk/zgc 19
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
java 1.java 71ms 3.3ms 61.0MB 72ms 8ms graal/jvm 17.0.4
java 1.java 76ms 2.2ms 40.3MB 78ms 8ms openjdk 19
java 1.java 82ms 3.1ms 42.4MB 76ms 10ms openjdk 20
java 1.java 121ms 3.2ms 41.8MB 78ms 54ms openjdk/zgc 19
elixir 1.ex 214ms 2.3ms 46.4MB 238ms 32ms elixir 13.1.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 4962ms 12ms 381.9MB 5330ms 123ms graal/jvm 17.0.4
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20
java 1.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 19

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
elixir 1.ex 1309ms 14ms 48.0MB 1340ms 137ms elixir 13.1.0
java 1.java 1344ms 7.9ms 378.3MB 1653ms 77ms graal/jvm 17.0.4
java 1.java 1429ms 20ms 279.4MB 1793ms 67ms openjdk 19
java 1.java 1437ms 13ms 294.7MB 1797ms 73ms openjdk 20
java 1.java 1999ms 43ms 1032.3MB 2023ms 640ms openjdk/zgc 19

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2-m.java 4304ms 3.1ms 108.4MB 8300ms 40ms graal/jvm 17.0.4
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0
java 2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 19
java 2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk 20
java 2.java timeout 0.0ms 0.0MB 0ms 0ms openjdk/zgc 19

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2-m.java 1236ms 17ms 104.3MB 2263ms 53ms graal/jvm 17.0.4
java 2-m.java 1594ms 56ms 44.3MB 3033ms 7ms openjdk 20
java 2-m.java 1771ms 183ms 44.6MB 3290ms 53ms openjdk/zgc 19
java 2-m.java 1825ms 192ms 44.4MB 3473ms 17ms openjdk 19
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
java 2-m.java 430ms 9.7ms 99.1MB 727ms 30ms graal/jvm 17.0.4
java 2-m.java 589ms 3.9ms 44.2MB 1060ms 13ms openjdk 19
java 2-m.java 600ms 7.1ms 42.7MB 1070ms 20ms openjdk 20
java 2-m.java 648ms 11ms 44.4MB 1083ms 53ms openjdk/zgc 19
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0