The Computer Language
Benchmarks Game

Haskell GHC versus OCaml 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.

regex-redux
source secs mem gz busy cpu load
Haskell GHC 0.97 308,072 2213 2.32 46% 51% 80% 62%
OCaml 14.72 901,956 637 14.73 0% 100% 0% 0%
mandelbrot
source secs mem gz busy cpu load
Haskell GHC 1.47 31,136 1975 5.83 99% 99% 99% 100%
OCaml 7.49 4,940 717 29.88 100% 100% 99% 100%
pidigits
source secs mem gz busy cpu load
Haskell GHC 0.89 6,048 1694 0.90 0% 100% 1% 0%
OCaml 4.44 19,152 458 4.57 23% 79% 0% 1%
fasta
source secs mem gz busy cpu load
Haskell GHC 0.86 8,008 1882 2.80 83% 80% 81% 81%
OCaml 3.28 195,488 1189 3.30 1% 0% 100% 0%
spectral-norm
source secs mem gz busy cpu load
Haskell GHC 1.48 4,124 987 5.73 96% 97% 96% 98%
OCaml 5.35 3,504 377 5.38 0% 0% 100% 0%
n-body
source secs mem gz busy cpu load
Haskell GHC 6.95 4,188 1883 26.84 95% 95% 100% 95%
OCaml 6.70 1,364 1251 6.78 100% 1% 0% 0%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 4.34 522,348 811 16.37 94% 97% 94% 93%
OCaml 4.06 152,740 751 11.25 39% 73% 85% 80%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 10.22 4,148 1113 40.27 100% 99% 100% 95%
OCaml 8.86 19,588 1004 35.42 100% 100% 100% 100%
k-nucleotide
source secs mem gz busy cpu load
Haskell GHC 20.11 522,844 1059 74.17 94% 90% 95% 91%
OCaml 14.99 255,568 1833 41.18 94% 99% 40% 42%
reverse-complement
source secs mem gz busy cpu load
Haskell GHC 2.92 501,644 1020 3.43 6% 100% 6% 6%
OCaml 1.64 33,612 1368 4.26 61% 64% 69% 66%
Haskell GHC

The Glorious Glasgow Haskell Compilation System,
version 8.10.1

OCaml

The OCaml native-code compiler, version 4.10.0