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-Thread: 103376,7767a311e01e1cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed01.chello.at!newsfeed02.chello.at!news.hispeed.ch.POSTED!not-for-mail Message-ID: <10563461.i0KLV1J6I7@linux1.krischik.com> From: Martin Krischik Subject: Re: GNAT compiler switches and optimization Newsgroups: comp.lang.ada Date: Fri, 20 Oct 2006 17:41:12 +0200 References: <1161341264.471057.252750@h48g2000cwc.googlegroups.com> User-Agent: KNode/0.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@hispeed.ch Organization: hispeed.ch NNTP-Posting-Host: 80.218.115.143 (80.218.115.143) NNTP-Posting-Date: Fri, 20 Oct 2006 17:45:05 +0200 X-Trace: c66ac4538ef01f57fd62a11658 Xref: g2news2.google.com comp.lang.ada:7083 Date: 2006-10-20T17:41:12+02:00 List-Id: Duncan Sands wrote: > On Friday 20 October 2006 12:47, tkrauss wrote: >> I'm a bit stuck trying to figure out how to coax more performance >> out of some Ada code. I suspect there is something simple (like >> compiler switches) but I'm missing it. As an example I'm using >> a simple matrix multiply and comparing it to similar code in >> Fortran. Unfortunately the Ada code takes 3-4 times as long. > > GNAT GPL 2006 is based on gcc 3.4.6. For fortran you are using > gcc 4.2.0. Try using comparable compiler versions, eg: an Ada > aware gcc 4.2.0 (several linux distributions provide this) or > a gcc 3.4.6 version of fortran (i.e. some version of g77). Indeed. GNAT/GPL: ./Linux-x86_64-Release/Test_Array_1 800 1.99202E+02 1.96854E+02 1.88844E+02 1.84498E+02 Time: 12.265258000 GNAT/GCC: ./Linux-x86_64-Release/Test_Array_1 800 1.99202E+02 1.96854E+02 1.88844E+02 1.84498E+02 Time: 10.631787000 So who said the 4.1.x compiler are slower... Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com