The Computer Language
Benchmarks Game

Haskell GHC versus OCaml fastest programs

Always look at the source code.

These are only the fastest programs. Do some of them use manually vectorized SIMD? 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 1.07 345,128 2213 2.47 59% 44% 44% 83%
OCaml 14.84 901,904 637 15.29 100% 0% 1% 1%
mandelbrot
source secs mem gz busy cpu load
Haskell GHC 1.51 37,504 1975 5.98 99% 99% 99% 99%
OCaml 7.56 4,620 717 30.12 100% 100% 99% 100%
fasta
source secs mem gz busy cpu load
Haskell GHC 0.88 7,628 1882 3.32 94% 96% 93% 93%
OCaml 3.27 203,380 1189 3.31 1% 0% 0% 100%
spectral-norm
source secs mem gz busy cpu load
Haskell GHC 1.47 3,964 987 5.71 97% 97% 97% 97%
OCaml 5.36 3,436 377 5.37 0% 0% 100% 0%
n-body
source secs mem gz busy cpu load
Haskell GHC 6.42 4,176 1883 6.47 0% 0% 0% 100%
OCaml 6.72 1,464 1251 6.76 0% 100% 0% 1%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 9.95 3,764 1113 39.18 95% 100% 99% 100%
OCaml 8.52 19,072 1004 34.08 100% 100% 100% 100%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 5.02 449,868 811 18.05 90% 85% 93% 91%
OCaml 4.04 152,736 751 11.19 39% 77% 68% 93%
k-nucleotide
source secs mem gz busy cpu load
Haskell GHC 22.02 638,132 1486 85.78 97% 99% 97% 97%
OCaml 14.87 255,560 1833 40.68 48% 50% 86% 90%
pidigits
source secs mem gz busy cpu load
Haskell GHC 1.64 7,792 360 2.06 9% 99% 7% 9%
OCaml 0.74 6,144 593 0.78 0% 0% 100% 4%
reverse-complement
source secs mem gz busy cpu load
Haskell GHC   Make Error
OCaml 1.66 34,044 1368 4.25 61% 65% 61% 69%
Haskell GHC

The Glorious Glasgow Haskell Compilation System,
version 9.0.1

OCaml

The OCaml native-code compiler, version 4.11.0