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,e7e6e919cef50811 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-15 02:44:53 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.net.uni-c.dk!uninett.no!not-for-mail From: Reinert Korsnes Newsgroups: comp.lang.ada Subject: Re: comparing gnat/Ada95 and g77 Date: Fri, 15 Mar 2002 11:44:10 +0100 Organization: UNINETT news service Message-ID: References: <3c907c86.6094213@news.demon.co.uk> NNTP-Posting-Host: sthrkou.ffi.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: snipp.uninett.no 1016189091 15048 193.156.99.159 (15 Mar 2002 10:44:51 GMT) X-Complaints-To: news-abuse@uninett.no User-Agent: KNode/0.6.1 Xref: archiver1.google.com comp.lang.ada:21272 Date: 2002-03-15T11:44:10+01:00 List-Id: Thanks all for response. For the Ada95 program I used: gnatmake test1.adb -cargs -O3 -ffast-math and for the Fortran version I used: f77 -c -O3 -ffast-math test1.f (and f77 -o test1 test1.o) Ada: 11.8 s Fortran: 2.7 s Maybe "-ffast-math" is silently ignored (not "legal") for gnat since it is "dirty" ? Without "-ffast-math" the Fortran version takes about 10.3 s . reinert PS: yes, I did NOT try to make a program doing anything meaningful except for figuring out compile options. John McCabe wrote: > On Thu, 14 Mar 2002 10:47:18 +0100, Reinert Korsnes > wrote: > >>Hi, >> >>Could anybody try these two programs (Ada and Fortran) >>and see if it is possible to make the Ada version (via compile >>options) to run as fast as the Fortran version under Linux, gnat >>and g77 ? > > What do you mean by "as fast as"? Do you have some figures already? > What are the differences? > > I can't see any reason (other than constraint checking which can be > switched off) why the actual calculations should be any different, but > you might find that the IO takes longer in Ada than in Fortran because > it is obviously a bit more complicated (3 subroutine calls instead of > 1) and, as you're doing this within a *huge* loop, any slight > degradation here will be significant.