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-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!g1g2000vbr.googlegroups.com!not-for-mail From: jonathan Newsgroups: comp.lang.ada Subject: Re: GNAT's stack checking in Ubuntu 9.04 (and Shootout regex-dna) Date: Mon, 10 Aug 2009 13:12:58 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9adb4985-582c-4cbf-906c-3afa7dcd31f6@g1g2000vbr.googlegroups.com> References: <4a776a94$0$31878$9b4e6d93@newsspool3.arcor-online.net> <4a7f1fc5$0$31344$9b4e6d93@newsspool4.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: quoted-printable X-Trace: posting.google.com 1249935185 4777 127.0.0.1 (10 Aug 2009 20:13:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 10 Aug 2009 20:13:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g1g2000vbr.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:7672 Date: 2009-08-10T13:12:58-07:00 List-Id: On Aug 9, 8:13=A0pm, Georg Bauhaus wrote: I was going to give up on regexdna.adb, but I had to try one last thing. (That's the trouble with these danged benchmarks). I wanted to recompile the GNAT.spitbol packages .. the quickest thing I could think of was copy the source into my working directory and rename them. GNAT.spitbol to GNAT_spitbol, and GNAT.spitbol.patterns to GNAT_spitbol.patterns. The advantage of this is you can modify them. The first thing I tried worked rather well: I replaced Stack_Size : constant Positive :=3D 2000; with Stack_Size : constant Positive :=3D 129; in GNAT_spitbol.patterns. The program running time (single-core) dropped from 47 seconds to 32 seconds. (You can set Stack_Size to 17, with all validity checks enabled, and still get the right answer.) (Used the latest GNAT GPL, which seems to have fewer optimizations disabled than earlier GNAT's. Also, I ran it on a 3.2 GHz 4-core INTEL .. faster than the one used at that benchmarking site.) I used gnatmake with -O3 -gnatnp -funroll-all-loops -march=3Dnative regexdna.adb Unfortunately, you need to do more work to get earlier GNAT's to do this ... missing "System.String_Hash" or something. Last remark: someone with experience using the spitbol routines might be able to optimize further. There are tricks using "anchors" mentioned in spec of GNAT.spitbol.patterns. Jonathan