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!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 19 Aug 2009 23:37:26 +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> In-Reply-To: <9b7557ca-df60-4d70-b692-f077b71983eb@g10g2000yqh.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4a8c7099$0$32664$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 19 Aug 2009 23:37:29 CEST NNTP-Posting-Host: 973955c9.newsspool2.arcor-online.net X-Trace: DXC=X?Ac]72\[LG[kmHKHnaEnMA9EHlD;3YcB4Fo<]lROoRA^YC2XCjHcbIdbW4:b0`Ka@KQDKiQ7h Martin wrote: > Isn't there something that could be done about the lines: > > return Unbounded.To_String (Data_Buffer); > end Read; > and > Buffer : constant String := Read; As a first try, I'm playing with the lightweight bounded strings package (from the program), which is generic in Jonathan Parker's version; since a C++ program uses a large buffer, we might try this as well, i.e. instantiate the package for large strings and replace Unbounded.Append with our own Append, effectively reading directly into the target string. > ...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? Stream_IO might be faster, but the rules say that we have to read line-by-line. Would we not end up reinventing a buffering scheme for line oriented standard I/O? (Could be of some general utility, anyway, I'd think. GNAT seems to be using C library function wrappers for its high speed reading.)