From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9c3a1871d2161925 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-04 10:32:29 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.174.75.178!news-fra1.dfn.de!news.esoc.esa.de!not-for-mail From: Colin Paul Gloster Newsgroups: comp.lang.ada Subject: Re: C/Ada performance comparison Date: Wed, 04 Jul 2001 19:27:21 +0200 Organization: not from Colin Paul Gloster if posted after 28th September 2001 Message-ID: <3B4351F9.D901BEEC@ACM.org> References: <3B3C8E6A.39361C75@labe.felk.cvut.cz> <3B424298.9A7849CF@boeing.com> Reply-To: Colin_Paul_Gloster@ACM.org NNTP-Posting-Host: cgloster.esoc.esa.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.51 [en] (Win95; U) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:9436 Date: 2001-07-04T19:27:21+02:00 List-Id: 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.