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.

mandelbrot
source secs mem gz busy cpu load
Haskell GHC 1.51 37,504 1975 5.98 99% 99% 99% 99%
OCaml 7.53 4,480 717 30.02 100% 100% 100% 100%
fasta
source secs mem gz busy cpu load
Haskell GHC 0.88 7,628 1882 3.32 94% 96% 93% 93%
OCaml 3.28 203,300 1189 3.29 0% 0% 100% 0%
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,448 377 5.36 0% 0% 0% 100%
regex-redux
source secs mem gz busy cpu load
Haskell GHC 1.07 345,128 2213 2.47 59% 44% 44% 83%
OCaml 2.37 510,132 647 4.12 72% 1% 100% 1%
pidigits
source secs mem gz busy cpu load
Haskell GHC 0.83 6,056 928 0.84 0% 99% 1% 1%
OCaml 0.89 5,968 593 0.90 0% 0% 1% 100%
n-body
source secs mem gz busy cpu load
Haskell GHC 6.42 4,176 1883 6.47 0% 0% 0% 100%
OCaml 6.70 1,468 1251 6.70 100% 0% 0% 0%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 5.02 449,868 811 18.05 90% 85% 93% 91%
OCaml 4.68 152,716 751 13.23 78% 99% 42% 64%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 9.95 3,764 1113 39.18 95% 100% 99% 100%
OCaml 8.66 18,900 1004 34.60 100% 100% 100% 100%
k-nucleotide
source secs mem gz busy cpu load
Haskell GHC 22.02 638,132 1486 85.78 97% 99% 97% 97%
OCaml 15.09 255,396 1833 40.72 38% 94% 64% 74%
reverse-complement
source secs mem gz busy cpu load
Haskell GHC 3.36 501,696 1041 3.97 6% 100% 6% 6%
OCaml 1.68 34,024 1368 4.31 56% 57% 75% 69%
Haskell GHC

The Glorious Glasgow Haskell Compilation System,
version 9.0.1

OCaml

The OCaml native-code compiler, version 4.12.0