Perl VS OCaml benchmarks

Current benchmark data was generated on Wed Feb 08 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8171M 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
ocaml 1.ml timeout 0.0ms 139.4MB 4927ms 50ms ocaml 5.0.0
perl 1.pl timeout 0.0ms 77.7MB 4957ms 27ms perl 5.36.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 395ms 6.2ms 22.9MB 363ms 13ms ocaml 5.0.0
perl 1.pl 2570ms 26ms 14.3MB 2550ms 3ms perl 5.36.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 6.ml 450ms 2.9ms 22.7MB 433ms 3ms ocaml 5.0.0
perl 1.pl timeout 0.0ms 11.1MB 4970ms 3ms perl 5.36.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 6.ml 50ms 0.4ms 4.9MB 37ms 0ms ocaml 5.0.0
perl 1.pl 536ms 6.3ms 6.8MB 523ms 0ms perl 5.36.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 2.6ms 0.9ms 2.9MB 0ms 0ms ocaml 5.0.0
perl 1.pl 3.8ms 0.6ms 5.1MB 0ms 0ms perl 5.36.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 668ms 18ms 2.9MB 653ms 0ms ocaml 5.0.0
perl 2.pl timeout 0.0ms 6.4MB 4987ms 3ms perl 5.36.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 74ms 3.1ms 2.9MB 63ms 0ms ocaml 5.0.0
perl 2.pl 3680ms 19ms 6.3MB 3667ms 0ms perl 5.36.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml timeout 0.0ms 4.0MB 4983ms 0ms ocaml 5.0.0
perl 4.pl timeout 0.0ms 8.2MB 9847ms 3ms perl 5.36.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml 1802ms 7.5ms 3.6MB 1787ms 0ms ocaml 5.0.0
perl 4.pl timeout 0.0ms 9.6MB 9703ms 3ms perl 5.36.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml 475ms 16ms 3.4MB 460ms 0ms ocaml 5.0.0
perl 4.pl timeout 0.0ms 8.3MB 9687ms 10ms perl 5.36.0