Results for 38 of 40 languages from this run on actest1.

Unavailable in this run: Hack, Lisp. Follow the run link for failure details.

OCaml VS Java benchmarks

Current benchmark data was generated on Sun Sep 27 2026, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] Intel(R) Core(TM) i7-3687U CPU @ 2.10GHz (Model 58)

* -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
java 2.java 782ms 124ms 569.1MB 957ms 133ms openjdk 21.0.12
java 2.java 1276ms 44ms 1086.4MB 900ms 603ms openjdk/zgc 21.0.12
ocaml 1.ml 5051ms 131ms 156.9MB 4967ms 63ms ocaml 5.3.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2.java 192ms 18ms 167.6MB 260ms 27ms openjdk 21.0.12
java 2.java 378ms 84ms 239.8MB 267ms 200ms openjdk/zgc 21.0.12
ocaml 1.ml 379ms 6.4ms 19.3MB 360ms 3ms ocaml 5.3.0

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 1447ms 19ms 48.4MB 5427ms 17ms openjdk 21.0.12
java 1-m.java 1642ms 7.4ms 44.3MB 5787ms 113ms openjdk/zgc 21.0.12
ocaml 2.ml 3708ms 10ms 2.7MB 3697ms 0ms ocaml 5.3.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 248ms 7.6ms 47.8MB 690ms 23ms openjdk 21.0.12
ocaml 2.ml 341ms 78ms 4.8MB 327ms 0ms ocaml 5.3.0
java 1-m.java 348ms 18ms 44.1MB 810ms 93ms openjdk/zgc 21.0.12

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 6.ml 349ms 5.9ms 23.0MB 333ms 0ms ocaml 5.3.0
java 4.java 471ms 5.9ms 48.4MB 617ms 17ms openjdk 21.0.12
java 4.java 569ms 9.0ms 44.2MB 627ms 110ms openjdk/zgc 21.0.12

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 6.ml 41ms 1.4ms 5.5MB 27ms 0ms ocaml 5.3.0
java 4-m.java 171ms 12ms 47.1MB 250ms 23ms openjdk 21.0.12
java 4.java 237ms 6.5ms 41.9MB 237ms 93ms openjdk/zgc 21.0.12

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 2.3ms 0.5ms 3.1MB 0ms 0ms ocaml 5.3.0
java 1.java 93ms 5.3ms 44.3MB 116ms 12ms openjdk 21.0.12
java 1.java 165ms 3.2ms 42.8MB 128ms 88ms openjdk/zgc 21.0.12

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 271ms 4.6ms 6.5MB 257ms 0ms ocaml 5.3.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 760ms 12ms 6.4MB 750ms 0ms ocaml 5.3.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 131ms 26ms 5.9MB 120ms 0ms ocaml 5.3.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 639ms 19ms 672.5MB 787ms 113ms openjdk 21.0.12
java 1.java 1091ms 23ms 952.0MB 723ms 573ms openjdk/zgc 21.0.12
ocaml 1.ml 1750ms 70ms 71.3MB 1707ms 27ms ocaml 5.3.0
ocaml 2.ml 3254ms 22ms 92.0MB 3210ms 30ms ocaml 5.3.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1-m.java 244ms 6.2ms 203.4MB 380ms 43ms openjdk 21.0.12
ocaml 1.ml 285ms 24ms 21.8MB 267ms 0ms ocaml 5.3.0
java 1.java 494ms 111ms 341.8MB 367ms 237ms openjdk/zgc 21.0.12
ocaml 2.ml 599ms 0.6ms 27.8MB 570ms 10ms ocaml 5.3.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 697ms 7.9ms 2.7MB 687ms 0ms ocaml 5.3.0
java 1.java 836ms 7.8ms 45.3MB 903ms 20ms openjdk 21.0.12
java 1.java 948ms 8.1ms 42.6MB 943ms 97ms openjdk/zgc 21.0.12
java 2.java 2391ms 105ms 668.4MB 2600ms 133ms openjdk 21.0.12
java 2.java 4242ms 39ms 2140.1MB 3463ms 1093ms openjdk/zgc 21.0.12

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 1.ml 75ms 1.3ms 2.7MB 67ms 0ms ocaml 5.3.0
java 1-m.java 192ms 4.7ms 45.4MB 267ms 23ms openjdk 21.0.12
java 1.java 284ms 11ms 45.1MB 267ms 110ms openjdk/zgc 21.0.12
java 2-m.java 470ms 6.5ms 319.0MB 713ms 53ms openjdk 21.0.12
java 2.java 889ms 1.9ms 558.5MB 850ms 327ms openjdk/zgc 21.0.12

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 1105ms 7.1ms 117.6MB 1193ms 27ms openjdk 21.0.12
java 1.java 1321ms 17ms 111.7MB 1293ms 140ms openjdk/zgc 21.0.12
java 2.java 1354ms 46ms 57.9MB 1457ms 20ms openjdk 21.0.12
java 2.java 1474ms 28ms 53.3MB 1470ms 117ms openjdk/zgc 21.0.12
ocaml 1.ml 1803ms 29ms 547.7MB 1730ms 57ms ocaml 5.3.0
ocaml 2.ml 3669ms 69ms 19.0MB 3653ms 0ms ocaml 5.3.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 1.java 315ms 5.1ms 65.5MB 413ms 17ms openjdk 21.0.12
java 2.java 395ms 1.2ms 48.3MB 503ms 10ms openjdk 21.0.12
ocaml 1.ml 424ms 2.5ms 133.8MB 393ms 13ms ocaml 5.3.0
java 1.java 431ms 36ms 60.2MB 433ms 113ms openjdk/zgc 21.0.12
java 2.java 475ms 3.8ms 47.7MB 473ms 113ms openjdk/zgc 21.0.12
ocaml 2.ml 745ms 19ms 9.3MB 730ms 0ms ocaml 5.3.0

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml 6927ms 135ms 485.2MB 6767ms 147ms ocaml 5.3.0
java 3.java 8627ms 72ms 563.4MB 9447ms 103ms openjdk 21.0.12
java 3.java 9355ms 276ms 737.5MB 9407ms 507ms openjdk/zgc 21.0.12

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 2.ml 707ms 9.4ms 57.3MB 673ms 17ms ocaml 5.3.0
java 3-m.java 1230ms 47ms 131.7MB 1947ms 43ms openjdk 21.0.12
java 3.java 1312ms 29ms 134.7MB 1800ms 130ms openjdk/zgc 21.0.12

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2-m.java 6269ms 79ms 47.7MB 24327ms 20ms openjdk 21.0.12
java 2-m.java 6422ms 61ms 45.2MB 24347ms 163ms openjdk/zgc 21.0.12
ocaml 2.ml 11056ms 13ms 4.6MB 11043ms 0ms ocaml 5.3.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2-m.java 1680ms 11ms 46.0MB 6267ms 40ms openjdk 21.0.12
java 2-m.java 1805ms 63ms 44.1MB 6343ms 120ms openjdk/zgc 21.0.12
ocaml 2.ml 2773ms 3.9ms 4.1MB 2760ms 0ms ocaml 5.3.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
java 2-m.java 551ms 4.8ms 48.2MB 1853ms 20ms openjdk 21.0.12
java 2-m.java 646ms 7.1ms 45.7MB 1900ms 103ms openjdk/zgc 21.0.12
ocaml 2.ml 702ms 3.3ms 3.3MB 687ms 0ms ocaml 5.3.0