comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jeffrey.carter@boeing.com>
Subject: Re: C/Ada performance comparison
Date: Tue, 3 Jul 2001 22:09:28 GMT
Date: 2001-07-03T22:09:28+00:00	[thread overview]
Message-ID: <3B424298.9A7849CF@boeing.com> (raw)
In-Reply-To: 3B3C8E6A.39361C75@labe.felk.cvut.cz

Tomas Hlavaty wrote:
> 
> I have a question about the CPU load of Ada programs. I have a program
> reimplemented from C to Ada (Linux, GNAT) and now I've found the Ada
> program consumes about 7 times more CPU time than the C one. Is it
> common case or does it indicate an error in my Ada implementation (I'm
> quite new in Ada)? Is there any comparison/statistics on performance of
> C/Ada programs?

In general, equivalent Ada and C programs have equivalent run times.
Robert Dewar claims to have a collection of equivalent programs that
produce identical object code when compiled using gcc.

A factor of 7 implies that the programs are not equivalent. I suggest
you unknowingly used an expensive feature of Ada. Different levels of
optimization might also account for the difference.

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%.

-- 
Jeffrey Carter



  parent reply	other threads:[~2001-07-03 22:09 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 [this message]
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
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