÷

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

This chart shows 3 comparisons - Time-used, Memory-used and Code-used.

Each chart bar shows, for one unidentified benchmark, how much the fastest OCaml program used compared to the fastest C++ GNU g++ program.


 Step 2 : Are the OCaml programs faster? Approximately.

This table shows 3 comparisons - Time-used, Memory-used and Code-used.

Each table row shows, for one named benchmark, how much the fastest OCaml program used compared to the fastest C++ GNU g++ program.

 OCaml used what fraction? used how many times more? 
Benchmark Time Memory Code Reduced N
 fannkuch±±1/2
 regex-dna1/3 500,000
 spectral-norm1/3
 n-body±±
 pidigits±
 fasta±±
 k-nucleotide±1/2 2,500,000
 binary-trees1/2±
 reverse-complement±1/6
 mandelbrot1/361/2
 chameneos-redux16×±±

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

 Step 3 : Are the OCaml programs faster? Measurements.

This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ~ CPU Load.

For each named benchmark, measurements of the fastest OCaml program are shown for comparison against measurements of the fastest C++ GNU g++ program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ~ CPU Load
 fannkuch 
OCaml61.3761.37756485  0% 0% 0% 100%
C++ GNU g++50.0150.011,1241186  0% 0% 0% 100%
 regex-dna N = 500,000 reduced workload 
OCaml2.172.1748,788615  0% 1% 0% 100%
C++ GNU g++1.431.436,9041759  1% 0% 1% 100%
 spectral-norm 
OCaml18.8418.841,632377  0% 0% 0% 100%
C++ GNU g++11.9411.941,0041114  0% 0% 1% 100%
 n-body 
OCaml56.8956.896841239  0% 0% 0% 100%
C++ GNU g++23.8123.817881428  0% 1% 0% 100%
 pidigits 
OCaml6.636.632,744560  0% 0% 0% 100%
C++ GNU g++2.712.711,596682  0% 0% 1% 100%
 fasta 
OCaml11.7911.807281042  0% 0% 0% 100%
C++ GNU g++3.763.778161470  0% 0% 0% 100%
 k-nucleotide N = 2,500,000 reduced workload 
OCaml5.995.9940,4921205  0% 0% 0% 100%
C++ GNU g++1.891.8927,3522673  0% 1% 0% 100%
 binary-trees 
OCaml44.9544.9578,852784  0% 0% 0% 100%
C++ GNU g++13.4713.47148,652892  0% 0% 0% 100%
 reverse-complement 
OCaml4.784.78168,920394  0% 0% 0% 100%
C++ GNU g++1.121.12245,4322275  1% 0% 1% 100%
 mandelbrot 
OCaml113.76113.75844441  0% 0% 0% 100%
C++ GNU g++24.5524.5530,564858  0% 0% 0% 100%
 chameneos-redux 
OCaml64.9964.991,3801279  0% 0% 0% 100%
C++ GNU g++4.024.021,2441606  0% 0% 0% 100%

 Measurements for all the accepted programs

 OCaml : modular type-safe strict functional programming plus objects 

The Objective Caml native-code compiler, version 3.11.0

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

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

Revised BSD license