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

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 : Are the Ada 2005 GNAT programs faster? Approximately.

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± ±
 spectral-norm± 
 mandelbrot± 
 fasta± 
 pidigits± 
 fasta-redux± ±
 reverse-complement±±±
 k-nucleotide
 regex-dna1/2
 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 : Are the Ada 2005 GNAT 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 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 GNAT17.725.21176,8682167  93% 81% 95% 75%
C++ g++27.048.03357,812892  58% 97% 91% 94%
 fannkuch-redux 
Ada 2005 GNAT38.259.611,9762100  100% 99% 100% 100%
C++ g++53.3313.631,2641440  100% 98% 99% 94%
 spectral-norm 
Ada 2005 GNAT7.882.011,9282762  99% 99% 99% 99%
C++ g++10.092.544961044  99% 99% 100% 100%
 mandelbrot 
Ada 2005 GNAT22.755.7532,1041805  99% 99% 99% 99%
C++ g++23.775.9732,3881017  100% 100% 100% 100%
 fasta 
Ada 2005 GNAT4.114.111,4922186  0% 1% 100% 2%
C++ g++4.234.231,0721286  1% 95% 1% 5%
 pidigits 
Ada 2005 GNAT2.302.302,0721254  0% 1% 100% 3%
C++ g++2.292.301,656682  1% 0% 0% 100%
 fasta-redux 
Ada 2005 GNAT2.062.061,4881909  0% 1% 0% 100%
C++ g++1.781.788241474  0% 2% 100% 1%
 reverse-complement 
Ada 2005 GNAT0.980.83198,9083220  31% 80% 11% 4%
C++ g++1.020.65247,5082275  17% 64% 34% 48%
 k-nucleotide 
Ada 2005 GNAT29.9311.18276,6924865  61% 64% 59% 85%
C++ g++24.797.34154,7841252  81% 80% 81% 97%
 regex-dna 
Ada 2005 GNAT17.885.80123,8523492  77% 77% 87% 68%
C++ g++5.273.55198,920695  9% 49% 69% 26%
 n-body 
Ada 2005 GNAT15.4315.441,4882427  1% 1% 100% 0%
C++ g++9.359.354321544  98% 1% 3% 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

GNAT 4.6

gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

Home Page: The Libre Site

Download: Download GNAT GPL and SPARK GPL Editions

Revised BSD license

  Home   Conclusions   License   Play