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-7-bit X-Google-Thread: 103376,1d575f572a099528 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-07 09:02:39 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!129.240.148.23!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: What is faster Ada or C? Date: Fri, 7 Dec 2001 17:02:38 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: 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: kiuk0156.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1007744558 11356 129.241.83.82 (7 Dec 2001 17:02:38 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Fri, 7 Dec 2001 17:02:38 +0000 (UTC) User-Agent: slrn/0.9.7.3 (Linux) Xref: archiver1.google.com comp.lang.ada:17584 Date: 2001-12-07T17:02:38+00:00 List-Id: On Fri, 7 Dec 2001 16:45:36 +0000 (UTC), 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? No. This is the problem. >: 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 tried this too. It reduces the executiuon time with about 6% for C++ and 14% for the Ada program. Preben -- () Join the worldwide campaign to protect fundamental human rights. '||} {||' http://www.amnesty.org/