/mobile Handheld Friendly website

÷

 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.


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.

 OCaml used what fraction? used how many times more? 
Benchmark Time Memory Code
 reverse-complement †1/21/10±
 regex-dna1/211×±
 pidigits †±±
 k-nucleotide±±
 spectral-norm±±
 binary-trees±1/4±
 fannkuch-redux±
 mandelbrot1/9±
 n-body1/31/2
 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
 reverse-complement 
OCaml0.000.9012,6001314  62% 51% 67% 78% †
Haskell GHC1.901.73125,816999  42% 5% 5% 63% †
 regex-dna 
OCaml0.140.57445,0321050  75% 76% 95% 77%
Haskell GHC3.331.0539,7841518  88% 78% 81% 79%
 pidigits 
OCaml3.803.815,704560  76% 0% 1% 24% †
Haskell GHC6.584.175,972341  36% 51% 38% 34% †
 k-nucleotide 
OCaml6.322.86227,6921789  32% 29% 66% 100%
Haskell GHC9.072.6247,6241965  90% 84% 90% 83%
 spectral-norm 
OCaml17.994.793,092938  99% 99% 99% 99%
Haskell GHC15.724.061,248984  97% 97% 97% 97%
 binary-trees 
OCaml41.3316.37101,016784  95% 69% 55% 35%
Haskell GHC36.9912.30365,756612  68% 67% 67% 99%
 fannkuch-redux 
OCaml0.0126.0718,5441017  100% 100% 100% 100%
Haskell GHC66.8017.023,2641153  100% 99% 100% 94%
 mandelbrot 
OCaml85.7621.553,988710  100% 100% 100% 100%
Haskell GHC43.9411.0233,928782  100% 100% 100% 100%
 n-body 
OCaml47.6747.685801239  1% 0% 0% 100%
Haskell GHC24.7724.022,0081874  11% 58% 35% 1%
 fasta 
OCaml11.7511.761,6361042  0% 0% 0% 100%
Haskell GHC4.283.802,276979  41% 62% 5% 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.00.1

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

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

Revised BSD license

  Home   Conclusions   License   Play