comp.lang.ada
 help / color / mirror / Atom feed
From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen)
Subject: Re: C/Ada performance comparison
Date: 5 Jul 2001 06:55:26 -0500
Date: 2001-07-05T06:55:26-05:00	[thread overview]
Message-ID: <ID2zrOcEzaHQ@eisner.encompasserve.org> (raw)
In-Reply-To: 3B44135F.90D9711A@ACM.org

In article <3B44135F.90D9711A@ACM.org>, Colin Paul Gloster <Colin_Paul_Gloster@ACM.org> writes:
> Samuel Tardieu <sam@rfc1149.net> wrote: "On  4/07, Colin Paul Gloster wrote:
> 
> | A factor of 7 implies that the programs are not equivalent. [..]
> 
> A typical example of that non-equivalence is a user not turning
> off exception
> checks. An Ada program with exceptions is not the equivalent of a
> C program
> without them."
> 
> I do not know of anyone who claimed that an Ada program with
> exceptions is equivalent to a C program sans them. I did say that
> an equivalent Ada83 program wherein the C and Ada83 versions
> use dynamic memory can hog a lot more memory than the C
> version. So far as we know, Tomas Hlavaty's Ada source has no
> such thing as exception handling. An Ada and a C program can be
> equivalent and that Ada(95, and 83) has better optional features which
> would impact performance does not mean that an equivalent program
> has to use similar resource levels to the C original. The factor of seven
> may hint that exceptions are used but a hint is not a proof.

Exception checks do not require any specific invocation in the source.
On some processors, there are no hardware functions to detect certain
exceptional conditions, so an Ada compiler will generate extra code
to check for such conditions and raise and exception if necessary.

I don't think there are any processors with hardware functions to
achieve array bounds checking, so things like that will always be
in generated Ada code (unless you run the Ada compiler in a mode
to turn them off).



  reply	other threads:[~2001-07-05 11:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-29 14:19 C/Ada performance comparison Tomas Hlavaty
2001-07-03 16:20 ` Marin David Condic
2001-07-03 19:09 ` tmoran
2001-07-03 22:09 ` Jeffrey Carter
2001-07-04 17:27   ` Colin Paul Gloster
2001-07-04 17:43     ` Samuel Tardieu
2001-07-05  7:12       ` Colin Paul Gloster
2001-07-05 11:55         ` Larry Kilgallen [this message]
2001-07-05 21:46         ` Robert Dewar
2001-07-05 13:37   ` Marin David Condic
2001-07-05 14:49     ` Jean-Pierre Rosen
replies disabled

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