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-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada Shootout program for K-Nucleotide (patches) Date: Wed, 19 Aug 2009 14:24:13 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: 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> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1250706253 18711 192.74.137.71 (19 Aug 2009 18:24:13 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 19 Aug 2009 18:24:13 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:t+vh5T8AVsUK0rvD+CIDAdpaOhY= Xref: g2news1.google.com comp.lang.ada:6905 Date: 2009-08-19T14:24:13-04:00 List-Id: Martin writes: > Isn't there something that could be done about the lines: > > return Unbounded.To_String (Data_Buffer); > end Read; > and > Buffer : constant String := 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? No. Neither is Strings.Unbounded. If you're trying to write fast code, I would experiment with avoiding both. - Bob