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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,1d575f572a099528 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-07 09:04:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!194.213.69.151!news.algonet.se!algonet!newsfeed1.uni2.dk!news.net.uni-c.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: What is faster Ada or C? Date: Fri, 07 Dec 2001 18:04:44 +0100 Organization: Centre for Chaos and Turbulence Studies, Niels Bohr Institute Message-ID: <3C10F6AC.64CA02A2@nbi.dk> References: <3c08314d$0$158$9b622d9e@news.freenet.de> <3C0BA624.7A12BFA1@boeing.com> <3C10C26B.AA451459@nbi.dk> NNTP-Posting-Host: alf.nbi.dk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.net.uni-c.dk 1007744684 16970 130.225.212.55 (7 Dec 2001 17:04:44 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Fri, 7 Dec 2001 17:04:44 +0000 (UTC) X-Mailer: Mozilla 4.78 [en] (X11; U; OSF1 V4.0 alpha) X-Accept-Language: fo,da,no,sv,is,de,fr,en Xref: archiver1.google.com comp.lang.ada:17586 Date: 2001-12-07T18:04:44+01:00 List-Id: Preben Randhol wrote: > On Fri, 07 Dec 2001 14:21:47 +0100, Jacob Sparre Andersen wrote: > > > > Related to that, I have two simple, apparantly equivalent > > programs written in respectively Ada and C++, where the GNU > > Ada and C++ compilers find it difficult to produce even > > roughly equivalent binary code or processing speed. > > > > * Why are the two programs below not equivalent? > > * How can I get the Ada program to run as fast as the C++ > > program? > > Did you use the same gcc compiler? No. The problem is that GNU Ada does not inline the Sqrt function, while GNU C++ inlines the sqrt function. Jacob -- SSLUG's julekalender - fra den 1. til den 24. december p�: http://www.sslug.dk/julekalender/