vs

 1 : Are the OCaml programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest OCaml program used compared to the fastest Haskell GHC program.

(Memory use is only compared for tasks that require memory to be allocated.)


These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.

 2 : Are the OCaml programs faster? Approximately.

Each table row shows, for one named benchmark, how much the fastest OCaml program used compared to the fastest Haskell GHC program.

(Memory use is only compared for tasks that require memory to be allocated.)

 OCaml used what fraction? used how many times more? 
Benchmark Time Memory Code
 regex-dna1/215×±
 reverse-complement †1/21/10±
 k-nucleotide±±
 pidigits †± 
 binary-trees±1/4±
 spectral-norm± ±
 fannkuch-redux ±
 n-body 1/2
 mandelbrot ±
 fasta ±
 OCaml used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/21/2±±

† possible mismatch - one-core program compared to multi-core program.

± read the measurements and then read the program source code.

 3 : Are the OCaml programs faster? Measurements.

These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.

For each named benchmark, measurements of the fastest OCaml program are shown for comparison against measurements of the fastest Haskell GHC program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 regex-dna 
OCaml0.140.56445,1881050  75% 75% 78% 98%
Haskell GHC3.290.9730,2081518  84% 89% 86% 88%
 reverse-complement 
OCaml0.000.8912,6441314  52% 57% 83% 67% †
Haskell GHC1.541.45125,956999  3% 6% 4% 100% †
 k-nucleotide 
OCaml6.002.40228,0721789  36% 37% 88% 93%
Haskell GHC8.922.5855,4561965  88% 84% 88% 88%
 pidigits 
OCaml3.803.815,700560  0% 0% 1% 100% †
Haskell GHC4.953.496,152341  14% 15% 100% 13% †
 binary-trees 
OCaml40.1416.27101,028784  36% 95% 49% 69%
Haskell GHC40.3313.56398,172612  66% 67% 100% 66%
 spectral-norm 
OCaml18.245.273,232938  87% 97% 95% 85%
Haskell GHC15.704.041,420984  97% 97% 97% 98%
 fannkuch-redux 
OCaml0.0026.4218,6961017  100% 100% 100% 100%
Haskell GHC64.4516.433,4521153  100% 100% 99% 94%
 n-body 
OCaml49.9249.935961239  0% 0% 0% 100%
Haskell GHC25.0024.402,1921874  1% 1% 100% 1%
 mandelbrot 
OCaml150.0337.713,736710  100% 100% 100% 99%
Haskell GHC48.0612.0433,272782  100% 100% 100% 100%
 fasta 
OCaml12.1612.171,6561042  1% 0% 1% 100%
Haskell GHC3.943.662,464979  4% 100% 3% 4%
 fasta-redux
   No programs

† possible mismatch - one-core program compared to multi-core program.

 4 : Are there other OCaml programs for these benchmarks?

Remember - those are just the fastest OCaml and Haskell GHC programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for OCaml.

Maybe one of those other OCaml programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest OCaml and Haskell GHC programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.

Maybe one of those other programs is fastest on a different OS/machine.

 OCaml : modular type-safe strict functional programming plus objects 

The OCaml native-code compiler, version 4.01.0

Home Page: http://www.ocaml.org/

Download: http://caml.inria.fr/download.en.html

Revised BSD license

  Home   Conclusions   License   Play