OCaml VS Dart 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
dart 1.dart 1260ms 24ms 79.6MB 1227ms 40ms dart/exe 3.1.0-63.0.dev
dart 1.dart 1292ms 5.7ms 85.7MB 1250ms 40ms dart/exe 2.19.6
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
dart 1.dart 113ms 4.2ms 41.8MB 83ms 17ms dart/exe 3.1.0-63.0.dev
dart 1.dart 118ms 2.2ms 49.6MB 93ms 13ms dart/exe 2.19.6
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
ocaml 2.ml 3637ms 2.2ms 2.7MB 3620ms 0ms ocaml 5.0.0
dart 2.dart 4275ms 2.0ms 11.7MB 4263ms 0ms dart/exe 2.19.6
dart 2.dart 4385ms 5.7ms 5.5MB 4370ms 0ms dart/exe 3.1.0-63.0.dev

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
dart 2.dart 355ms 2.5ms 5.5MB 343ms 0ms dart/exe 3.1.0-63.0.dev
dart 2.dart 355ms 12ms 13.7MB 337ms 3ms dart/exe 2.19.6

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
dart 1.dart 514ms 1.4ms 8.5MB 500ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 532ms 6.5ms 14.2MB 507ms 3ms dart/exe 2.19.6

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
dart 1.dart 61ms 0.5ms 8.0MB 47ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 63ms 0.5ms 14.4MB 50ms 0ms dart/exe 2.19.6

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
dart 1.dart 6.0ms 2.5ms 6.2MB 0ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 8.1ms 0.9ms 13.7MB 0ms 0ms dart/exe 2.19.6

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 220ms 4.5ms 8.9MB 207ms 0ms dart/exe 3.1.0-63.0.dev
dart 2.dart 239ms 11ms 17.2MB 223ms 0ms dart/exe 2.19.6
ocaml 1.ml 250ms 4.9ms 6.7MB 240ms 0ms ocaml 5.0.0
dart 1.dart 1053ms 4.2ms 8.7MB 1033ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 1068ms 3.5ms 16.8MB 1053ms 0ms dart/exe 2.19.6

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 642ms 2.6ms 8.7MB 623ms 3ms dart/exe 3.1.0-63.0.dev
dart 2.dart 678ms 10ms 15.1MB 657ms 3ms dart/exe 2.19.6
ocaml 1.ml 727ms 1.6ms 6.7MB 717ms 0ms ocaml 5.0.0
dart 1.dart 3140ms 6.3ms 8.4MB 3123ms 3ms dart/exe 3.1.0-63.0.dev
dart 1.dart 3182ms 6.6ms 14.9MB 3160ms 7ms dart/exe 2.19.6

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 103ms 1.5ms 8.5MB 90ms 0ms dart/exe 3.1.0-63.0.dev
ocaml 1.ml 110ms 0.4ms 6.0MB 93ms 0ms ocaml 5.0.0
dart 2.dart 112ms 2.4ms 14.8MB 93ms 0ms dart/exe 2.19.6
dart 1.dart 177ms 2.8ms 9.2MB 160ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 181ms 2.3ms 17.0MB 167ms 3ms dart/exe 2.19.6

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 611ms 6.7ms 62.9MB 587ms 27ms dart/exe 3.1.0-63.0.dev
dart 1.dart 624ms 5.7ms 70.8MB 590ms 27ms dart/exe 2.19.6
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
dart 1.dart 146ms 2.8ms 48.7MB 117ms 13ms dart/exe 2.19.6
dart 1.dart 152ms 3.7ms 43.2MB 113ms 20ms dart/exe 3.1.0-63.0.dev
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
dart 3.dart 592ms 2.0ms 5.8MB 577ms 0ms dart/exe 3.1.0-63.0.dev
dart 3.dart 612ms 15ms 14.0MB 593ms 0ms dart/exe 2.19.6

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
dart 3.dart 69ms 3.5ms 5.9MB 57ms 0ms dart/exe 3.1.0-63.0.dev
dart 3.dart 1073ms 2.3ms 13.5MB 60ms 0ms dart/exe 2.19.6

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
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
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
dart 1.dart timeout 0.0ms 158.6MB 4923ms 47ms dart/exe 2.19.6
dart 1.dart timeout 0.0ms 161.3MB 4923ms 60ms dart/exe 3.1.0-63.0.dev
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
dart 1.dart 696ms 4.2ms 47.8MB 650ms 27ms dart/exe 3.1.0-63.0.dev
dart 1.dart 708ms 0.7ms 56.3MB 673ms 23ms dart/exe 2.19.6
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
dart 1.dart 4795ms 3.3ms 5.8MB 4783ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart timeout 0.0ms 11.6MB 4987ms 0ms dart/exe 2.19.6
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
dart 1.dart 1208ms 2.7ms 5.7MB 1193ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 1405ms 1.9ms 11.9MB 1390ms 0ms dart/exe 2.19.6
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
dart 1.dart 308ms 1.8ms 5.8MB 293ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 361ms 2.1ms 13.8MB 343ms 0ms dart/exe 2.19.6
ocaml 2.ml 394ms 0.4ms 3.3MB 380ms 0ms ocaml 5.0.0