1 : At a glance - Are the Ada 2005 GNAT programs faster?

Each chart bar shows, for one unidentified benchmark, how much the fastest Ada 2005 GNAT program used compared to the fastest C++ g++ 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 : Approximately - Are the Ada 2005 GNAT programs faster?

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

(Memory use is only compared for tasks that require memory to be allocated.)

 Ada 2005 GNAT used what fraction? used how many times more? 
Benchmark Time Memory Code
 binary-trees1/21/2
 fannkuch-redux± ±
 fasta± 
 mandelbrot± 
 pidigits± 
 spectral-norm± 
 fasta-redux± ±
 reverse-complement±±±
 regex-dna±
 k-nucleotide
 n-body 
 Ada 2005 GNAT used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/21/2±±±

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

 3 : Measurements - Are the Ada 2005 GNAT programs faster?

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 Ada 2005 GNAT 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
 binary-trees 
Ada 2005 GNAT18.005.46178,5082167  93% 76% 77% 88%
C++ g++27.948.28359,596892  90% 76% 91% 83%
 fannkuch-redux 
Ada 2005 GNAT44.8311.274,1002100  100% 100% 99% 100%
C++ g++51.9113.281,7841439  94% 99% 100% 98%
 fasta 
Ada 2005 GNAT4.064.071,9882186  1% 0% 0% 100%
C++ g++4.224.231,4601286  2% 1% 0% 100%
 mandelbrot 
Ada 2005 GNAT24.146.0932,0041805  99% 99% 100% 99%
C++ g++24.406.1337,8921017  100% 100% 100% 100%
 pidigits 
Ada 2005 GNAT2.292.294,2241254  1% 0% 7% 100%
C++ g++2.292.293,440682  1% 100% 1% 0%
 spectral-norm 
Ada 2005 GNAT7.872.004,2242762  99% 99% 99% 98%
C++ g++7.881.991,7561278  99% 99% 100% 99%
 fasta-redux 
Ada 2005 GNAT1.981.981,9601909  0% 3% 1% 99%
C++ g++1.661.661,4761474  2% 100% 0% 1%
 reverse-complement 
Ada 2005 GNAT0.910.78203,0363220  79% 3% 4% 37%
C++ g++0.950.58214,0122275  41% 26% 14% 86%
 regex-dna 
Ada 2005 GNAT16.485.49126,2083492  64% 93% 77% 67%
C++ g++5.373.64183,796695  35% 65% 3% 48%
 k-nucleotide 
Ada 2005 GNAT25.6811.63278,4684865  100% 19% 42% 62%
C++ g++24.427.16153,8961252  92% 88% 82% 81%
 n-body 
Ada 2005 GNAT18.0018.001,9082436  0% 100% 1% 0%
C++ g++9.409.409441544  0% 0% 100% 1%

 4 : Are there other Ada 2005 GNAT programs for these benchmarks?

Remember - those are just the fastest Ada 2005 GNAT and C++ g++ programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Ada 2005 GNAT.

Maybe one of those other Ada 2005 GNAT programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Ada 2005 GNAT 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.

 Ada 2005 GNAT : large-scale safety-critical software 

Ada 2012 as a Parallel Language for High Performance Computing (pdf)

book Ada Distilled: An introduction to Ada Programming for Experienced Computer Programmers, Richard Riehle, 2003 (pdf)

wikibook Ada Programming

GNATMAKE 4.9.2

gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)

Home Page: The Libre Site

Download: Download GNAT GPL and SPARK GPL Editions

Revised BSD license

  Home   Conclusions   License   Play