comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <dewar@gnat.com>
Subject: Re: GNAT & GCC performace (bad news)
Date: 1999/12/03
Date: 1999-12-03T00:00:00+00:00	[thread overview]
Message-ID: <828lra$7lr$1@nnrp1.deja.com> (raw)
In-Reply-To: B46CA6A1.2991%Harald.Schmidt@tomcat.de

In article <B46CA6A1.2991%Harald.Schmidt@tomcat.de>,
  Harald Schmidt <Harald.Schmidt@tomcat.de> wrote:

> What I was expecting,
> because gnat isn't a compiler env. but a to-C(++) translator

No, that's completely wrong, GNAT has nothing to do with C or
C++, it is a compiler structured in the traditional manner.

  Front end converts to intermediate code
  Code generator generates code from intermediate code

What may confuse you is that gcc is a multi-language compiler
and also provides C and C++ front ends which compile into the
same intermediate code.

> the performance decrease about ten to twenty percent but
> not 50 percent.


You always have to remember that you are NOT compiling the
same code. One set of code is in C and the other in Ada. As
always performance is a strong factor not only of the machine
and compiler, but also how the code is written. Basically what
your results show is that the Ada code is written in a manner
that runs twice as slow as the C code.

That does not necessarily mean that the Ada code is bad, since
often we take advantage of Ada's high level features to make
the code clearer, but there can be an efficiency cost associated
with this.

The test you refer to is only valid, to the extent that it is
valid at all, for comparing one Ada compiler to another, or one
C compiler to another, but the Ada vs C is apples vs oranges
since you are comparing two different programs. It is certainly
possible to write an Ada program that will perform comparably
with the C program (in fact if you are comparing GNAT and GNU C,
it is usually possible to get the Ada program to output
identical binary text for the program.

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




      parent reply	other threads:[~1999-12-03  0:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-02  0:00 GNAT & GCC performace (bad news) Harald Schmidt
1999-12-02  0:00 ` Dmitriy Anisimkov
1999-12-02  0:00 ` Tucker Taft
1999-12-02  0:00 ` nabbasi
1999-12-02  0:00 ` David Starner
1999-12-02  0:00 ` James E. Hopper
1999-12-03  0:00   ` Robert A Duff
1999-12-04  0:00   ` Robert Dewar
1999-12-04  0:00     ` Harald Schmidt
1999-12-03  0:00 ` Mats Weber
1999-12-03  0:00 ` Geoff Bull
1999-12-03  0:00   ` Larry Kilgallen
1999-12-06  0:00     ` Robert Dewar
1999-12-06  0:00       ` Larry Kilgallen
1999-12-06  0:00         ` Robert A Duff
1999-12-07  0:00           ` Robert Dewar
1999-12-07  0:00             ` Tucker Taft
1999-12-08  0:00               ` Robert Dewar
1999-12-08  0:00                 ` Ada2001
1999-12-09  0:00             ` Wes Groleau
1999-12-10  0:00               ` Robert Dewar
1999-12-10  0:00                 ` Arthur Evans Jr
1999-12-11  0:00                   ` Robert Dewar
1999-12-17  0:00               ` Richard Kenner
1999-12-07  0:00         ` Robert Dewar
1999-12-03  0:00   ` Geoff Bull
1999-12-03  0:00 ` Robert Dewar [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox