Re: Ada vs. C performance, was Possible to write compiler to Java VM?

Laurent Guerby <Laurent.Guerby@enst-bretagne.fr>
9 Jan 1997 22:02:19 -0500

          From comp.compilers

Related articles
Ada vs. C performance, was Possible to write compiler to Java VM? robison@kai.com (Arch Robison) (1997-01-07)
Re: Ada vs. C performance, was Possible to write compiler to Java VM? Laurent.Guerby@enst-bretagne.fr (Laurent Guerby) (1997-01-09)
Ada vs. C performance, was Possible to write compiler to Java VM? rgh@shellus.com (1997-01-09)
Re: Ada vs. C performance, was Possible to write compiler to Java VM? ronald.ten-hove@itron.com (Ron Ten-Hove) (1997-01-12)
Re: Ada vs. C performance, was Possible to write compiler to Java VM? toon@moene.indiv.nluug.nl (Toon Moene) (1997-01-12)
Re: Ada vs. C performance, was Possible to write compiler to Java VM? cdg@nullstone.com (Christopher Glaeser) (1997-01-14)
| List of all articles for this month |

From: Laurent Guerby <Laurent.Guerby@enst-bretagne.fr>
Newsgroups: comp.compilers
Date: 9 Jan 1997 22:02:19 -0500
Organization: ENST de Bretagne, Brest FRANCE
References: 97-01-045
Keywords: Ada, C, performance

Arch Robison <robison@kai.com> writes:
> >[Do Ada compilers really generate better code than C compilers for similar
> >source code? -John]
> [...] This is of course a single data point, probably obsolete. But I think
> there is a strong reason to suspect that C compilers will generally
> generate better code than Ada compilers. [...]


      Of course the argument doesn't hold with GNAT since the backend is
the same for Ada and C. I'm pretty sure that for every C program, you
can write an Ada program (C-style) that will generate the same code. I
don't know if in some case the reverse is false and if indeed GCC take
advantage of more semantic information (write an Ada program with no C
equivalent for performance).


      I agree that optimization is a commercial issue, so pinpointing
early Ada compilers is not really relevant (except for creating myth
of inefficiency ;-).


      A minor point, it's easy, given a factor k, to write an Ada program
that will outperform the "same" C program, just put a large local
array in a procedure and call it a lot, in C it must be initialized to
zero, and this is not the case in Ada so it will be faster (how
semantic can affect performance ;-). (I don't think there's a way to
have non zero'ed data on the stack in C.)


--
Laurent Guerby <guerby@gnat.com>, Team Ada.
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.