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,3a6a9f1d654285ba X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsfeed.velia.net!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 17 Aug 2009 17:46:40 +0200 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada Shootout program for K-Nucleotide (patches) References: <4a743343$0$32674$9b4e6d93@newsspool2.arcor-online.net> <4bc4b12d-40f8-4140-8ef6-326d9e6b8adf@k30g2000yqf.googlegroups.com> In-Reply-To: <4bc4b12d-40f8-4140-8ef6-326d9e6b8adf@k30g2000yqf.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4a897b61$0$30221$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 17 Aug 2009 17:46:41 CEST NNTP-Posting-Host: 51c392d1.newsspool1.arcor-online.net X-Trace: DXC=XRgYZK:[cPC0YVY]kmLTlDic==]BZ:afN4Fo<]lROoRA^YC2XCjHcbIaFPj0KE8T^J;9OJDO8_SKFNSZ1n^B98iJR jonathan schrieb: > On Aug 1, 1:21 pm, Georg Bauhaus bug.bauh...@maps.futureapps.de> wrote: >> This is about the K-Nucleotide program at the >> Computer Language Benchmark Game,http://shootout.alioth.debian.org/u32/benchmark.php?test=knucleotide&... >> where some Ada programs have started to fail. > > I took a 2nd look at your single core knucleotide.adb. > > http://home.arcor.de/bauhaus/Ada/knucleotide.gnat > > I was able to speed it up by 40% to 50% with one > change: I inlined the hashing function by hand. > Its not the prettiest code, but this is after > all an optimization exercise. I had played with the Hashing algorithm to no avail and forgot something that ... if it is ... obvious! Thanks. For comparison I have tried Hash calling a new inlined Element function from the Fragments string package. With just that change, then, and full inlining the speedup is 20%... Because of the desructive effects of -gnatN in an experimental version of the regexdna program, I speculate that inlining by hand might be more reliable.