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 Path: g2news2.google.com!news2.google.com!postnews.google.com!h21g2000yqa.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Ada Shootout program for K-Nucleotide (patches) Date: Tue, 4 Aug 2009 01:23:14 -0700 (PDT) Organization: http://groups.google.com Message-ID: <17c58792-2251-4762-9ecb-6f839851ed95@h21g2000yqa.googlegroups.com> References: <4a743343$0$32674$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1249374194 9115 127.0.0.1 (4 Aug 2009 08:23:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 4 Aug 2009 08:23:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h21g2000yqa.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7559 Date: 2009-08-04T01:23:14-07:00 List-Id: On Aug 1, 1:21=A0pm, Georg Bauhaus wrote: > This is about the K-Nucleotide program at the > Computer Language Benchmark Game,http://shootout.alioth.debian.org/u32/be= nchmark.php?test=3Dknucleotide&... > where some Ada programs have started to fail. > > In order to have one of them work again, I have patched > knucleotide.gnat, with some success. =A0New version is here:http://home.a= rcor.de/bauhaus/Ada/knucleotide.gnat > > Comments? =A0Does it work on your machine? > > The two changes: > > 1 - [stack exhaustion] a loop reading input lines into an > =A0ubounded =A0string replaces the recursive String "&"ing > =A0procedure. (Noting that the input text file is ~240MB ...) > > 2 - [heavy bounded strings] a lightweight bounded string ADT > =A0replaces an instance of Generic_Bounded_Length, yielding > =A0an improved running time of ~22s down from ~30s for > =A0the 2,500,000 case. > > Still, on a relatively small virtual machine running 64bit > Debian, the program cannot handle the 25,000,000 case. Is the line...: return Left.Last =3D Right.Last and then Left.Data(1 .. Left.Last) =3D Right.Data(1 .. Right.Last); ...doing the 1st check twice? Once explicitly and then won't it be checked again in 'Standard."=3D" (L, R : String) return Boolean'? It might be faster to do the check if it is more likely to be False than True (could be cheaper than a call to Standard."=3D") but it might be worth testing out... Cheers -- Martin