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,028 2213 2.31 64% 46% 81% 47%
OCaml 14.84 901,904 637 15.29 100% 0% 1% 1%
mandelbrot
source secs mem gz busy cpu load
Haskell GHC 1.47 38,268 1975 5.82 99% 100% 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,948 1882 2.87 81% 82% 81% 81%
OCaml 3.27 203,380 1189 3.31 1% 0% 0% 100%
spectral-norm
source secs mem gz busy cpu load
Haskell GHC 1.48 4,044 987 5.71 96% 96% 97% 96%
OCaml 5.36 3,436 377 5.37 0% 0% 100% 0%
pidigits
source secs mem gz busy cpu load
Haskell GHC 0.75 5,992 1694 0.76 0% 0% 1% 100%
OCaml 0.74 6,144 593 0.78 0% 0% 100% 4%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 4.11 519,284 811 15.16 92% 89% 91% 97%
OCaml 4.04 152,736 751 11.19 39% 77% 68% 93%
n-body
source secs mem gz busy cpu load
Haskell GHC 6.95 4,196 1883 26.83 95% 95% 95% 100%
OCaml 6.72 1,464 1251 6.76 0% 100% 0% 1%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 10.22 3,620 1113 40.23 100% 100% 95% 99%
OCaml 8.52 19,072 1004 34.08 100% 100% 100% 100%
k-nucleotide
source secs mem gz busy cpu load
Haskell GHC 20.01 522,656 1059 73.95 90% 91% 95% 94%
OCaml 14.87 255,560 1833 40.68 48% 50% 86% 90%
reverse-complement
source secs mem gz busy cpu load
Haskell GHC 2.95 501,572 1020 3.51 6% 6% 6% 100%
OCaml 1.66 34,044 1368 4.25 61% 65% 61% 69%
Haskell GHC

The Glorious Glasgow Haskell Compilation System,
version 8.10.1

OCaml

The OCaml native-code compiler, version 4.11.0