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: g2news1.google.com!postnews.google.com!g10g2000yqh.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Ada Shootout program for K-Nucleotide (patches) Date: Wed, 19 Aug 2009 09:40:59 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9b7557ca-df60-4d70-b692-f077b71983eb@g10g2000yqh.googlegroups.com> References: <4a743343$0$32674$9b4e6d93@newsspool2.arcor-online.net> <4bc4b12d-40f8-4140-8ef6-326d9e6b8adf@k30g2000yqf.googlegroups.com> <4a897b61$0$30221$9b4e6d93@newsspool1.arcor-online.net> <4d48b846-bb2d-4126-86c2-487b2244c9ad@d4g2000yqa.googlegroups.com> <4a8c119d$0$31866$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 86.173.159.32 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1250700060 11080 127.0.0.1 (19 Aug 2009 16:41:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 19 Aug 2009 16:41:00 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g10g2000yqh.googlegroups.com; posting-host=86.173.159.32; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.0.10, Ant.com Toolbar 1.3,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:6904 Date: 2009-08-19T09:40:59-07:00 List-Id: On Aug 19, 3:52=A0pm, Georg Bauhaus wrote: > jonathan schrieb: > > > OK, I did some more work on knuceotide.adb. =A0I'll say in > > advance that the code may be .. a bit messy. =A0There is sometimes > > no way around this if you are trying for fast rather than elegant. > > Ada programs won't be alone in that camp, I think? ;-) > > > -- new version of "=3D". =A0(Tell me if its right;) [...] > > Gradually integrating all of your patches into the multitasking > version (in reversed order for no planned reason) gives the > following improvements on a machine with an AMD Athlon(tm) 64 X2 > Dual Core Processor 3800+, 2 GHz, 2GB RAM: > > N =3D 2,500,000 > > 10s - no patches > 8.7s - new "=3D" and public definition of Fragments.Bounded_String > 8.1s - increasing the read buffer size > 5.7s - manual inlining of the hashing function > 5.1s - changing Hash_Type to include 1 .. 2**17 - 1 > > GNAT 4.2.3 > > (Running the last version on 1 core, not 2, the real time doubled.) > > With N =3D 25,000,000 I get > > real =A0 =A00m50.467s > user =A0 =A01m28.540s > sys =A0 =A0 0m0.410s > > http://home.arcor.de/bauhaus/Ada/knucleotide.j.tasking.gnat > > As a precaution, I have allocated the larger read buffer on the heap. > Emacs Ada mode may have capitalized some identifiers; I hadn't > changed the presets on this machine. Isn't there something that could be done about the lines: return Unbounded.To_String (Data_Buffer); end Read; and Buffer : constant String :=3D Read; ...not sure what the answer is (don't have a compiler / debugger to hand just now but it just looks like there's a copy too many in there somewhere... Also, is using "Ada.Text_IO.Get_Line" particularly fast? Cheers -- Martin