÷

 Step 1 : Are the C++ GNU g++ 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 C++ GNU g++ program used compared to the fastest C GNU gcc program.


 Step 2 : Are the C++ GNU g++ 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 C++ GNU g++ program used compared to the fastest C GNU gcc program.

 C++ GNU g++ used what fraction? used how many times more? 
Benchmark Time Memory Code Reduced N
 k-nucleotide1/131/6
 regex-dna1/2±±
 reverse-complement±
 fasta±±
 spectral-norm±±
 pidigits±±
 mandelbrot±±±
 n-body±±
 fannkuch±±
 binary-trees±±
 chameneos-redux±

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

 Step 3 : Are the C++ GNU g++ 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 C++ GNU g++ program are shown for comparison against measurements of the fastest C GNU gcc program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ~ CPU Load
 k-nucleotide 
C++ GNU g++14.804.31132,4523415  81% 80% 99% 84%
C GNU gcc53.9653.96802,9281141  0% 0% 0% 100%
 regex-dna 
C++ GNU g++14.674.7897,0641759  84% 60% 100% 63%
C GNU gcc26.158.5094,7121525  67% 73% 67% 100%
 reverse-complement 
C++ GNU g++1.340.92245,4402275  68% 50% 14% 15%
C GNU gcc1.371.37125,192722  100% 1% 1% 1%
 fasta 
C++ GNU g++3.783.788161470  99% 1% 0% 0%
C GNU gcc5.185.193961221  100% 0% 0% 0%
 spectral-norm 
C++ GNU g++11.983.001,0321114  100% 100% 100% 100%
C GNU gcc12.003.006881139  100% 100% 100% 100%
 pidigits 
C++ GNU g++2.712.711,600682  0% 0% 0% 100%
C GNU gcc2.712.711,012541  0% 100% 0% 0%
 mandelbrot 
C++ GNU g++24.676.1730,436858  100% 100% 100% 100%
C GNU gcc24.386.1127,248879  100% 100% 100% 100%
 n-body 
C++ GNU g++23.8223.827881428  100% 0% 0% 0%
C GNU gcc23.5223.524161429  100% 0% 0% 0%
 fannkuch 
C++ GNU g++49.6113.631,1601186  81% 77% 100% 100%
C GNU gcc50.5412.88552937  98% 100% 98% 98%
 binary-trees 
C++ GNU g++18.866.32173,332892  60% 74% 74% 71%
C GNU gcc13.715.10100,688850  50% 34% 85% 81%
 chameneos-redux 
C++ GNU g++11.332.881,1681994  99% 99% 100% 97%
C GNU gcc2.840.725802879  100% 97% 99% 100%

 Measurements for all the accepted programs

 C++ GNU g++ : c plus objects plus generics 

C++ 1991-2006, Bjarne Stroustrup (pdf)

gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8)

Home Page: http://gcc.gnu.org/

Download: ftp://ftp.gnu.org/pub/gnu/gcc/

Revised BSD license