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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3a6a9f1d654285ba X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!k30g2000yqf.googlegroups.com!not-for-mail From: jonathan Newsgroups: comp.lang.ada Subject: Re: Ada Shootout program for K-Nucleotide (patches) Date: Fri, 14 Aug 2009 08:31:37 -0700 (PDT) Organization: http://groups.google.com Message-ID: <071e37a6-f454-408c-ae2d-9aa44004fc92@k30g2000yqf.googlegroups.com> References: <4a743343$0$32674$9b4e6d93@newsspool2.arcor-online.net> <2bae762e-0d8a-4389-843a-466e87f59fd1@a37g2000prf.googlegroups.com> <4a786b15$0$30230$9b4e6d93@newsspool1.arcor-online.net> <67e76046-62d4-4c0e-bdd8-8d00cdf93bca@l35g2000pra.googlegroups.com> <4a79f712$0$31874$9b4e6d93@newsspool3.arcor-online.net> <7a5aea9c-1ade-4d73-98ef-08d226823161@z31g2000yqd.googlegroups.com> <4a7a0826$0$31862$9b4e6d93@newsspool3.arcor-online.net> <4a7a96a2$0$31867$9b4e6d93@newsspool3.arcor-online.net> <4a7b4daa$0$31333$9b4e6d93@newsspool4.arcor-online.net> <211a9019-6b96-431d-a634-e399075110ec@t13g2000yqt.googlegroups.com> <4a848ec4$0$30231$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: 143.117.23.233 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1250263898 2839 127.0.0.1 (14 Aug 2009 15:31:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 14 Aug 2009 15:31:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k30g2000yqf.googlegroups.com; posting-host=143.117.23.233; posting-account=Jzt5lQoAAAB4PhTgRLOPGuTLd_K1LY-C User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.12) Gecko/2009072220 Iceweasel/3.0.6 (Debian-3.0.6-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7794 Date: 2009-08-14T08:31:37-07:00 List-Id: OK, I found a few more minutes to look at these things. Most important thing to remember: Whether you should use -funroll-loops, -funroll-all-loops, -gnatn, -gnatN, or none-of-the-above depends on the compiler. After a quick test using GNAT 4.3.2, none-of-the-above seems an acceptible choice. After another test using GNAT 4.3.4 (GPL 2009), -gnatN -funroll-loops seems quite a good choice. On both GNAT 4.3.2 and GNAT 4.3.4, -ffast-math is near essential for top speed. In fact it seemed even better with GNAT 4.3.2; 15% to 20% improvement. Well, -ffast-math isn't usually that good, so I took the trouble to find out what's going on. One thing (in retrospect the only thing) that could have shaved 15% off the running time was removal of the floating point division by replacing "x / constant" with "x * (1/constant)". To verify this I modified the code by replacing the "x / constant" with "x * (1/constant)" explicitly. When I did this the -ffast-math switch became unnecessary. I didn't know -ffast-math could do that. Jonathan