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: a07f3367d7,da39df064d0b18d7 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!b15g2000yqd.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: GNAT's stack checking in Ubuntu 9.04 (and Shootout regex-dna) Date: Wed, 12 Aug 2009 02:32:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4a776a94$0$31878$9b4e6d93@newsspool3.arcor-online.net> <4a7f1fc5$0$31344$9b4e6d93@newsspool4.arcor-online.net> <9adb4985-582c-4cbf-906c-3afa7dcd31f6@g1g2000vbr.googlegroups.com> <4a80bae9$0$31866$9b4e6d93@newsspool3.arcor-online.net> <1aec6b98-6c73-43cf-a54f-0b0bc844aeee@w6g2000yqw.googlegroups.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1250069537 23056 127.0.0.1 (12 Aug 2009 09:32:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 12 Aug 2009 09:32:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b15g2000yqd.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7693 Date: 2009-08-12T02:32:17-07:00 List-Id: jonathan wrote on comp.lang.ada: > Step 1. =A0Compile without the -a switch: > > =A0 -O3 -gnatnp -funroll-all-loops -march=3Dnative regexdna.adb > > =A0 Running time of ./regexdna: 63 seconds. > > =A0 Comment: compilation near instanteous; I suppose it is > =A0 linking to precompiled =A0Gnat.Spitbol.Pattern =A0packages. > > Step 2. =A0Compile with the -a switch: > > =A0 -O3 -a -gnatnp -funroll-all-loops -march=3Dnative regexdna.adb > > =A0 Running time of ./regexdna: 51 seconds. > > =A0 Comment: Compilation is slow. Looks like it is recompiling > =A0 the =A0Gnat.Spitbol.Pattern =A0packages. > > =A0 So it looks like the performance problem I was complaining > =A0 about was due to the suboptimal precompiled Spitbol.Pattern. > =A0 In fact it was almost *entirely* due to the sub-optimal > =A0 Spitbol.Pattern, because running time is now close > =A0 to the running time I get from the GNAT GPL compilation. > =A0 (The GNAT GPL I downloaded was for 64-bit machines. I > =A0 would speculate that the precompiled Spitbol.Pattern > =A0 used by the Debian Lenny GNAT was for more general > =A0 architectures.) If you use the amd64 port of Debian Lenny, your compiler is optimized for 64-bit. However, I use the default options for the library. For example, the i386 (actually i486) build daemon compiled g-spipat.adb thus: /build/buildd-gnat-4.3_4.3.2-1.1-i386-3dUv7K/gnat-4.3-4.3.2/build/./ gcc/xgcc -B/build/buildd-gnat-4.3_4.3.2-1.1-i386-3dUv7K/gnat-4.3-4.3.2/ build/./gcc/ -B/usr/i486-linux-gnu/bin/ -B/usr/i486-linux-gnu/lib/ - isystem /usr/i486-linux-gnu/include -isystem /usr/i486-linux-gnu/sys- include -c -g -O2 -W -Wall -gnatpg g-spipat.adb -o g-spipat.o If anyone is interested, I can try to compile with -O3 -funroll-all- loops -gnatpg instead. -- Ludovic Brenta (maintainer of gnat in Debian).