comp.lang.ada
 help / color / mirror / Atom feed
From: Colin Paul Gloster <Colin_Paul_Gloster@ACM.org>
Subject: Re: C/Ada performance comparison
Date: Wed, 04 Jul 2001 19:27:21 +0200
Date: 2001-07-04T19:27:21+02:00	[thread overview]
Message-ID: <3B4351F9.D901BEEC@ACM.org> (raw)
In-Reply-To: 3B424298.9A7849CF@boeing.com

Jeffrey Carter wrote:
"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. [..]"

If there is dynamic memory in the program then an Ada83 program
owing to a cautious policy can hog much more memory than an
equivalent C program. However, Ada95 overcame this and if he
is using GNAT (and is new to it) it is extremely unlikely that his
default switches are set to Ada83 so he is probably using Ada95.
Aside from that after writing some of this I looked back and saw
Tomas Hlavaty was talking about processor load and not memory
consumption. Oh well...posting this anyway.




  reply	other threads:[~2001-07-04 17:27 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 [this message]
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