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,90c3c79963d78580 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-10 11:43:44 PST Newsgroups: comp.lang.ada Path: newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.skycache.com!Cidera!news-reader.ntrnet.net!uunet!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Numerical Computation and Ada95 X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3AFADC46.FD0522A7@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <9dc4sh$ru5$1@ulysses.noc.ntua.gr> <9dc6io$a2g2@news.cis.okstate.edu> Mime-Version: 1.0 Date: Thu, 10 May 2001 18:21:58 GMT X-Mailer: Mozilla 4.5 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: newsfeed.google.com comp.lang.ada:7495 Date: 2001-05-10T18:21:58+00:00 List-Id: David Starner wrote: > > There's always the question on whether you want fast programs or > correct programs. (-: Most Ada compilers offer switches to turn off > run-time checks, so there should be practically no difference > between the speed of Fortran, C++ and Ada. (In practice, Ada seems > to be slightly slower (10-20%) even with the checks turned off. This > will of course vary widely depending on your program and enviroment.) This, I am glad to say, is simply wrong. Robert Dewar has a suite of equivalent Ada and C programs that generate *identical* object code when compiled with gcc. Back in the dark days of Ada 83, the highly optimized Tartan Ada compiler produced faster code than the C benchmarks Tartan used to convince people to buy their *C* compilers instead of using the free one that TI shipped with their DSPs. An article in _Ada Letters_ described the features of Ada and C that allowed them to do better optimization for Ada than for C. There was also a case of a Tartan Ada compiler producing faster code than hand-optimized assembler. This was described in a TRI-Ada presentation. The people developing the Ada made no special effort to make the code fast, because the purpose of the project was to prove that Ada was NOT fast enough. The project failed, sort of like the Tuskegee Airman project. In general, using modern compilers and modern processors, equivalent programs will produce equivalent execution times. -- Jeffrey Carter