comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <marin.condic.auntie.spam@pacemicro.com>
Subject: Re: C/Ada performance comparison
Date: Thu, 5 Jul 2001 09:37:14 -0400
Date: 2001-07-05T13:37:20+00:00	[thread overview]
Message-ID: <9i1qig$36o$1@nh.pace.co.uk> (raw)
In-Reply-To: 3B424298.9A7849CF@boeing.com

In general, I'd agree. However, there might be cases where this is not true.
If, for example, I'm doing a lot of computations in a tight loop over a
really large number of iterations, the constraint checking of numeric values
might add a considerable overhead. Imagine you write X := X + 1 ; That ought
to degenerate to a single add instruction with descent optimization, but if
you have to do the computation then check that you have not exceeded the
range of X's subtype and possibly do something to raise Constraint_Error,
that single instruction can expand to quite a few. Do that in a tight loop a
million times or so and you'll see some significant changes in performance.

Just for the record, turning off the checks should result in code just as
tight as what you'd get from a C compiler for a similar operation.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Jeffrey Carter" <jeffrey.carter@boeing.com> wrote in message
news:3B424298.9A7849CF@boeing.com...
> Tomas Hlavaty wrote:
>
> Although one of the factors for programs to be equivalent is run-time
> checks, I would not expect them to give a factor of 7 difference.
> Suppressing Ada run-time checks usually does not reduce run times by
> more than about 10%.
>






  parent reply	other threads:[~2001-07-05 13:37 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
2001-07-05 21:46         ` Robert Dewar
2001-07-05 13:37   ` Marin David Condic [this message]
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