OCaml VS Dart benchmarks

Current benchmark data was generated on Thu Sep 22 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.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 1022ms 3.0ms 87.4MB 997ms 30ms dart/exe 2.18.1
ocaml 1.ml 3969ms 9.3ms 121.0MB 3927ms 23ms ocaml 4.14.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 101ms 0.1ms 48.2MB 77ms 17ms dart/exe 2.18.1
ocaml 1.ml 271ms 1.1ms 17.4MB 250ms 3ms ocaml 4.14.0

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml 3940ms 31ms 2.5MB 3927ms 0ms ocaml 4.14.0
dart 2.dart 4300ms 7.2ms 13.6MB 4283ms 0ms dart/exe 2.18.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml 326ms 0.7ms 2.6MB 313ms 0ms ocaml 4.14.0
dart 2.dart 358ms 14ms 12.1MB 343ms 0ms dart/exe 2.18.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 6.ml 423ms 2.2ms 23.9MB 403ms 0ms ocaml 4.14.0
dart 1.dart 545ms 1.8ms 17.0MB 530ms 0ms dart/exe 2.18.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 6.ml 49ms 3.5ms 4.8MB 37ms 0ms ocaml 4.14.0
dart 1.dart 64ms 0.5ms 14.4MB 50ms 0ms dart/exe 2.18.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 1.9ms 0.5ms 2.5MB 0ms 0ms ocaml 4.14.0
dart 1.dart 807ms 448ms 11.6MB 0ms 0ms dart/exe 2.18.1

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 238ms 0.5ms 5.9MB 227ms 0ms ocaml 4.14.0
dart 2.dart 238ms 2.0ms 15.0MB 223ms 3ms dart/exe 2.18.1
dart 1.dart 1416ms 2.3ms 14.7MB 1407ms 0ms dart/exe 2.18.1

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 694ms 9.5ms 16.9MB 683ms 0ms dart/exe 2.18.1
ocaml 1.ml 707ms 1.5ms 5.8MB 693ms 0ms ocaml 4.14.0
dart 1.dart 4250ms 6.9ms 15.1MB 4233ms 10ms dart/exe 2.18.1

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 104ms 0.4ms 5.1MB 90ms 0ms ocaml 4.14.0
dart 2.dart 113ms 1.6ms 16.7MB 97ms 3ms dart/exe 2.18.1
dart 1.dart 208ms 3.9ms 14.0MB 190ms 0ms dart/exe 2.18.1

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 507ms 3.7ms 70.7MB 477ms 33ms dart/exe 2.18.1
ocaml 1.ml 1503ms 5.0ms 62.6MB 1460ms 23ms ocaml 4.14.0
ocaml 2.ml 2552ms 7.6ms 71.4MB 2520ms 20ms ocaml 4.14.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 126ms 0.9ms 51.1MB 100ms 17ms dart/exe 2.18.1
ocaml 1.ml 192ms 0.9ms 18.6MB 177ms 0ms ocaml 4.14.0
ocaml 2.ml 430ms 3.0ms 23.6MB 410ms 3ms ocaml 4.14.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 470ms 0.2ms 2.6MB 460ms 0ms ocaml 4.14.0
dart 3.dart 520ms 1.7ms 13.8MB 503ms 0ms dart/exe 2.18.1

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 52ms 3.8ms 2.6MB 40ms 0ms ocaml 4.14.0
dart 3.dart 60ms 1.1ms 14.0MB 50ms 0ms dart/exe 2.18.1

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 1976ms 10ms 555.7MB 1877ms 87ms ocaml 4.14.0
ocaml 2.ml 2265ms 1.2ms 19.9MB 2247ms 0ms ocaml 4.14.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 390ms 10ms 142.6MB 353ms 20ms ocaml 4.14.0
ocaml 2.ml 551ms 4.1ms 9.5MB 537ms 0ms ocaml 4.14.0

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart timeout 0.0ms 0.0MB 0ms 0ms dart/exe 2.18.1
ocaml 2.ml timeout 0.0ms 0.0MB 0ms 0ms ocaml 4.14.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml 683ms 0.6ms 50.4MB 657ms 10ms ocaml 4.14.0
dart 1.dart 804ms 3.1ms 56.2MB 780ms 13ms dart/exe 2.18.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart timeout 0.0ms 0.0MB 0ms 0ms dart/exe 2.18.1
ocaml 2.ml timeout 0.0ms 0.0MB 0ms 0ms ocaml 4.14.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 1297ms 1.1ms 12.1MB 1280ms 0ms dart/exe 2.18.1
ocaml 2.ml 1645ms 0.1ms 3.4MB 1633ms 0ms ocaml 4.14.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 331ms 0.7ms 13.7MB 317ms 0ms dart/exe 2.18.1
ocaml 2.ml 415ms 0.7ms 3.1MB 400ms 0ms ocaml 4.14.0