The Q6600
Benchmarks Game

OCaml versus Java fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

pidigits
source secs mem gz busy cpu load
OCaml 1.76 6,056 593 1.98 100% 6% 3% 4%
Java 1.83 34,848 764 1.95 99% 1% 4% 2%
n-body
source secs mem gz busy cpu load
OCaml 21.67 1,368 1251 23.26 3% 1% 100% 4%
Java 21.85 34,112 1489 22.16 1% 0% 0% 100%
fannkuch-redux
source secs mem gz busy cpu load
OCaml 16.37 19,584 1004 65.39 100% 100% 100% 100%
Java 16.12 33,168 1282 63.71 100% 98% 99% 98%
reverse-complement
source secs mem gz busy cpu load
OCaml 3.74 33,944 1368 8.90 62% 58% 60% 59%
Java 3.27 714,144 2183 7.54 47% 60% 66% 58%
binary-trees
source secs mem gz busy cpu load
OCaml 9.89 152,992 751 28.64 49% 64% 98% 79%
Java 8.28 948,040 835 28.20 80% 84% 87% 90%
mandelbrot
source secs mem gz busy cpu load
OCaml 14.02 5,048 717 55.89 99% 100% 100% 100%
Java 6.84 76,008 796 26.90 99% 98% 98% 98%
k-nucleotide
source secs mem gz busy cpu load
OCaml 21.32 255,548 1833 59.79 91% 48% 100% 42%
Java 9.14 403,576 1812 29.10 87% 72% 74% 86%
regex-redux
source secs mem gz busy cpu load
OCaml 25.23 901,944 637 27.09 4% 1% 100% 3%
Java 10.27 635,500 740 29.42 74% 81% 55% 76%
fasta
source secs mem gz busy cpu load
OCaml 6.00 199,124 1189 6.32 100% 1% 1% 4%
Java 2.22 43,096 2473 6.10 67% 83% 45% 80%
spectral-norm
source secs mem gz busy cpu load
OCaml 15.70 3,704 377 16.86 100% 3% 5% 0%
Java 4.15 36,428 950 16.26 98% 100% 98% 97%
OCaml

The OCaml native-code compiler, version 4.10.0

Java

openjdk 14 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)