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
 reverse-complement †1/21/4±
 regex-dna±±±
 n-body± 1/2
 fannkuch-redux± ±
 pidigits †± 
 k-nucleotide±±±
 spectral-norm± ±
 mandelbrot± ±
 binary-trees±1/4±
 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.7830,8401314  52% 29% 60% 78% †
Haskell GHC1.551.38126,340999  99% 4% 4% 4% †
 regex-dna 
OCaml1.468.96264,7441050  84% 95% 85% 85%
Haskell GHC35.699.52250,0081518  93% 91% 96% 96%
 n-body 
OCaml21.8621.877161239  100% 0% 0% 0%
Haskell GHC24.3523.172,7281874  2% 3% 100% 2%
 fannkuch-redux 
OCaml0.0016.3011,2801004  100% 100% 100% 100%
Haskell GHC63.3916.154,036834  99% 100% 100% 94%
 pidigits 
OCaml2.812.819,036560  0% 0% 100% 0% †
Haskell GHC3.982.716,212341  17% 16% 100% 17% †
 k-nucleotide 
OCaml55.5020.29253,6241789  39% 57% 79% 100%
Haskell GHC65.9917.73363,7801693  92% 93% 93% 97%
 spectral-norm 
OCaml16.824.783,512938  93% 91% 92% 90%
Haskell GHC15.704.041,940984  97% 97% 97% 97%
 mandelbrot 
OCaml55.8814.046,548710  100% 100% 100% 100%
Haskell GHC45.8111.4937,116782  100% 100% 100% 100%
 binary-trees 
OCaml71.0025.55201,744784  80% 41% 90% 69%
Haskell GHC64.7320.18813,620612  74% 74% 99% 74%
 fasta 
OCaml10.5110.52198,0801161  0% 0% 1% 100%
Haskell GHC4.494.022,732979  5% 6% 100% 5%
 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