/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 C++ g++ 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 C++ g++ program.

 OCaml used what fraction? used how many times more? 
Benchmark Time Memory Code
 pidigits±±
 reverse-complement1/2±
 k-nucleotide±
 binary-trees±1/2
 spectral-norm1/3
 regex-dna±
 fasta±
 fannkuch-redux1/2
 mandelbrot1/8±
 n-body±±
 OCaml used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±

± 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 C++ g++ program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 pidigits 
OCaml3.803.815,704560  1% 1% 0% 100%
C++ g++2.682.681,452682  0% 0% 1% 100%
 reverse-complement 
OCaml1.651.66127,5682064  0% 1% 1% 100%
C++ g++1.061.07245,3882275  0% 1% 0% 100%
 k-nucleotide 
OCaml5.785.7953,052870  0% 0% 1% 100%
C++ g++2.652.6520,6961252  1% 0% 4% 100%
 binary-trees 
OCaml35.7335.77115,688496  0% 0% 0% 100%
C++ g++15.8015.82148,440892  1% 0% 0% 100%
 spectral-norm 
OCaml18.8518.851,644377  0% 0% 0% 100%
C++ g++7.927.939241044  0% 0% 0% 100%
 regex-dna 
OCaml1.651.6557,792615  2% 1% 0% 100%
C++ g++0.590.596,320648  0% 0% 2% 100%
 fasta 
OCaml11.7511.751,6361042  0% 0% 1% 100%
C++ g++4.104.116201105  0% 0% 0% 100%
 fannkuch-redux 
OCaml73.4673.47580473  0% 0% 0% 100%
C++ g++25.0425.052921150  1% 0% 0% 100%
 mandelbrot 
OCaml85.7185.863,984710  0% 0% 0% 100%
C++ g++19.5819.6032,072726  0% 0% 0% 100%
 n-body 
OCaml47.6547.675801239  0% 0% 0% 100%
C++ g++10.4210.436201763  0% 1% 1% 100%
 fasta-redux 
No program
C++ g++0.030.03?1474  0% 0% 0% 100%

 4 : Are there other OCaml programs for these benchmarks?

Remember - those are just the fastest OCaml and C++ g++ 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 C++ g++ 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