OCaml VS Julia benchmarks

Current benchmark data was generated on Thu May 04 2023, 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.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 4.jl 1253ms 8.6ms 241.2MB 1127ms 207ms julia 1.8.5
ocaml 1.ml timeout 0.0ms 145.4MB 4903ms 73ms ocaml 5.0.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 4.jl 348ms 1.7ms 223.5MB 280ms 147ms julia 1.8.5
ocaml 1.ml 359ms 8.8ms 22.9MB 337ms 7ms ocaml 5.0.0

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 2-m.jl 1674ms 5.2ms 212.0MB 2850ms 140ms julia 1.8.5
ocaml 2.ml 3637ms 2.2ms 2.7MB 3620ms 0ms ocaml 5.0.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml 303ms 0.9ms 2.8MB 290ms 0ms ocaml 5.0.0
julia 2.jl 560ms 6.9ms 209.9MB 683ms 153ms julia 1.8.5

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 6.ml 387ms 4.7ms 22.7MB 360ms 7ms ocaml 5.0.0
julia 7-m.jl 672ms 8.8ms 293.5MB 887ms 190ms julia 1.8.5

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 6.ml 42ms 0.4ms 4.9MB 30ms 0ms ocaml 5.0.0
julia 7.jl 488ms 5.1ms 225.3MB 577ms 143ms julia 1.8.5

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 2.9ms 0.5ms 2.7MB 0ms 0ms ocaml 5.0.0
julia 1.jl 213ms 10ms 163.0MB 124ms 94ms julia/aot 1.8.5
julia 1.jl 225ms 1.7ms 170.9MB 142ms 98ms julia 1.8.5

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 250ms 4.9ms 6.7MB 240ms 0ms ocaml 5.0.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 727ms 1.6ms 6.7MB 717ms 0ms ocaml 5.0.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 110ms 0.4ms 6.0MB 93ms 0ms ocaml 5.0.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 1931ms 14ms 69.1MB 1880ms 30ms ocaml 5.0.0
ocaml 2.ml 3617ms 28ms 74.2MB 3557ms 43ms ocaml 5.0.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 275ms 3.8ms 25.6MB 253ms 3ms ocaml 5.0.0
ocaml 2.ml 629ms 19ms 30.1MB 610ms 7ms ocaml 5.0.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 546ms 8.2ms 2.9MB 533ms 0ms ocaml 5.0.0
julia 7.jl 551ms 4.6ms 168.3MB 510ms 130ms julia/aot 1.8.5
julia 7.jl 711ms 2.6ms 226.1MB 657ms 137ms julia 1.8.5

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 59ms 0.7ms 2.8MB 50ms 0ms ocaml 5.0.0
julia 7.jl 272ms 5.3ms 169.3MB 203ms 133ms julia/aot 1.8.5
julia 7.jl 433ms 3.5ms 223.5MB 377ms 140ms julia 1.8.5

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 1.jl 444ms 1.4ms 156.3MB 390ms 140ms julia/aot 1.8.5
julia 1.jl 554ms 3.9ms 203.0MB 497ms 143ms julia 1.8.5
ocaml 2.ml 2718ms 31ms 19.1MB 2703ms 0ms ocaml 5.0.0
ocaml 1.ml 3571ms 30ms 550.6MB 3400ms 157ms ocaml 5.0.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 1.jl 246ms 3.6ms 150.1MB 173ms 110ms julia/aot 1.8.5
julia 1.jl 361ms 5.5ms 195.4MB 297ms 143ms julia 1.8.5
ocaml 2.ml 640ms 4.4ms 9.3MB 627ms 0ms ocaml 5.0.0
ocaml 1.ml 763ms 24ms 140.2MB 713ms 30ms ocaml 5.0.0

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml timeout 0.0ms 181.9MB 4887ms 90ms ocaml 5.0.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml 715ms 2.6ms 52.5MB 673ms 27ms ocaml 5.0.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 2-m.jl 1232ms 2.9ms 196.0MB 2077ms 147ms julia 1.8.5
julia 3-m.jl 2183ms 35ms 208.2MB 3857ms 150ms julia 1.8.5
ocaml 2.ml timeout 0.0ms 4.2MB 4987ms 0ms ocaml 5.0.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
julia 2-m.jl 579ms 6.0ms 194.0MB 783ms 147ms julia 1.8.5
julia 3-m.jl 845ms 1.6ms 209.0MB 1257ms 153ms julia 1.8.5
ocaml 2.ml 1540ms 14ms 3.5MB 1527ms 0ms ocaml 5.0.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml 394ms 0.4ms 3.3MB 380ms 0ms ocaml 5.0.0
julia 2.jl 409ms 3.9ms 192.2MB 463ms 140ms julia 1.8.5
julia 3.jl 523ms 17ms 210.6MB 620ms 147ms julia 1.8.5