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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news1.google.com!news.glorb.com!news.doubleslash.org!open-news-network.org!news.teledata-fn.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 20 Aug 2009 01:50:30 +0200 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.22 (Windows/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> <4a897b61$0$30221$9b4e6d93@newsspool1.arcor-online.net> <4d48b846-bb2d-4126-86c2-487b2244c9ad@d4g2000yqa.googlegroups.com> <4a8c119d$0$31866$9b4e6d93@newsspool3.arcor-online.net> <9b7557ca-df60-4d70-b692-f077b71983eb@g10g2000yqh.googlegroups.com> <6f1c440c-9941-4aa7-a4cd-bf02a00db49a@g1g2000vbr.googlegroups.com> In-Reply-To: <6f1c440c-9941-4aa7-a4cd-bf02a00db49a@g1g2000vbr.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4a8c8fc8$0$32678$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 20 Aug 2009 01:50:32 CEST NNTP-Posting-Host: 93d542fa.newsspool2.arcor-online.net X-Trace: DXC=8GODOP6kMb1L2C_`koXfC5A9EHlD;3Yc24Fo<]lROoR1^YC2XCjHcb90DWemF[LilAFj7J6JhYn1=W2W@KPkIE> X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7890 Date: 2009-08-20T01:50:32+02:00 List-Id: jonathan wrote: > Ok, I finally put some print statements in to check. > ... > > From 1 to 2 takes 3.5 sec. It is reading 125 Meg of text line by line > and > discarding it. (Using Ada.Text_IO.Get_Line as the rules suggest.) > > From 2 to 3 takes 3.5 sec. It is reading 125 Meg of text line by line > and > storing it. (Using Ada.Text_IO.Get_Line as the rules suggest.) > > From 3 to 5 is well under 1 sec. From 4 to 5 is negligible. Similar durations here, although tested on Windows. Also, reading directly into a 128 MB target Buffer of type String (i.e. not appending chunks to an Unbounded_String and then performing To_String) seems to have a small effect only. Since a fixed buffer size makes the program fail when inputs grow, I think the temporary Unbounded_String is reasonable. There are only a few calls to Unbounded.* anyway. Get_Line seems to be the dominating subprogram here.