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:10:25 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:10:23 +0100 Organization: Centre for Chaos and Turbulence Studies, Niels Bohr Institute Message-ID: <3C10F7FF.5AFEFA97@nbi.dk> References: <3c08314d$0$158$9b622d9e@news.freenet.de> <3C0BA624.7A12BFA1@boeing.com> <3C10C26B.AA451459@nbi.dk> <9uqrng$s7k$1@a1-hrz.uni-duisburg.de> 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 1007745023 16972 130.225.212.55 (7 Dec 2001 17:10:23 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Fri, 7 Dec 2001 17:10:23 +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:17590 Date: 2001-12-07T18:10:23+01:00 List-Id: Georg Bauhaus wrote: > Jacob Sparre Andersen wrote: > > : * Why are the two programs below not equivalent? > : * How can I get the Ada program to run as fast as the C++ > : program? > > : with Ada.Numerics.Generic_Elementary_Functions; > : #include > > do the two sqrts in effect refer to the same routines? I can not see why they shouldn't. > : Ada.Text_IO.Put_Line ("X = " & Scalar'Image (X)); > > : cout << x << endl; > > have you tried with redirection to a null device, > or with no output? (terminal I/O might really slow thing > down.) I have tried with 100_000_000 iterations, and found about ten times as long execution times, as with 10_000_000 iterations. Jacob -- SSLUG's julekalender - fra den 1. til den 24. december p�: http://www.sslug.dk/julekalender/