÷

 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
 spectral-norm±
 regex-dna14×± 500,000
 binary-trees1/2±
 n-body±±
 fasta±±
 fannkuch±
 k-nucleotide±1/2 2,500,000
 reverse-complement±1/6
 pidigits±±
 mandelbrot10×±
 chameneos-redux81×±1/2

± 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
 spectral-norm 
OCaml18.585.803,112907  77% 83% 79% 81%
C++ GNU g++11.983.001,0321114  100% 100% 100% 100%
 regex-dna N = 500,000 reduced workload 
OCaml2.221.2696,4481261  24% 49% 83% 30%
C++ GNU g++1.820.536,9841759  80% 78% 98% 82%
 binary-trees 
OCaml54.0915.4578,852784  81% 100% 79% 90%
C++ GNU g++18.866.32173,332892  60% 74% 74% 71%
 n-body 
OCaml60.1460.146801239  0% 100% 0% 0%
C++ GNU g++23.8223.827881428  100% 0% 0% 0%
 fasta 
OCaml12.8812.887281042  0% 93% 0% 0%
C++ GNU g++3.783.788161470  99% 1% 0% 0%
 fannkuch 
OCaml178.7946.774,004975  93% 100% 94% 95%
C++ GNU g++49.6113.631,1601186  81% 77% 100% 100%
 k-nucleotide N = 2,500,000 reduced workload 
OCaml6.042.7540,4921205  24% 75% 41% 85%
C++ GNU g++2.350.7727,3802673  74% 66% 80% 86%
 reverse-complement 
OCaml4.784.78168,924394  100% 0% 0% 0%
C++ GNU g++1.340.92245,4402275  68% 50% 14% 15%
 pidigits 
OCaml21.0221.022,372510  0% 100% 0% 0%
C++ GNU g++2.712.711,600682  0% 0% 0% 100%
 mandelbrot 
OCaml230.9260.5457,616929  94% 100% 97% 94%
C++ GNU g++24.676.1730,436858  100% 100% 100% 100%
 chameneos-redux 
OCaml341.52232.501,5521286  38% 29% 39% 28%
C++ GNU g++11.332.881,1681994  99% 99% 100% 97%

 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