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.84 901,836 637 15.47 100% 3% 1% 0%
mandelbrot
source secs mem gz busy cpu load
Haskell GHC 1.47 31,136 1975 5.83 99% 99% 99% 100%
OCaml 7.55 4,944 717 30.12 100% 100% 100% 100%
fasta
source secs mem gz busy cpu load
Haskell GHC 0.86 8,008 1882 2.80 83% 80% 81% 81%
OCaml 3.26 188,324 1189 3.28 0% 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,428 377 5.38 0% 100% 0% 0%
pidigits
source secs mem gz busy cpu load
Haskell GHC 0.89 6,048 1694 0.90 0% 100% 1% 0%
OCaml 0.88 5,868 593 0.98 1% 100% 2% 8%
n-body
source secs mem gz busy cpu load
Haskell GHC 6.95 4,188 1883 26.84 95% 95% 100% 95%
OCaml 6.71 1,324 1251 6.74 100% 0% 0% 0%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 4.34 471,032 799 15.56 96% 88% 87% 87%
OCaml 4.06 152,700 751 11.16 55% 54% 84% 82%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 10.22 4,148 1113 40.27 100% 99% 100% 95%
OCaml 8.51 19,400 1004 33.97 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 15.08 255,464 1833 40.16 40% 36% 96% 95%
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,620 1368 4.25 63% 62% 68% 65%
Haskell GHC

The Glorious Glasgow Haskell Compilation System,
version 8.10.1

OCaml

The OCaml native-code compiler, version 4.11.0