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: 103376,8de7eedad50552f1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx01.iad01.newshosting.com!207.115.63.142.MISMATCH!newscon02.news.prodigy.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada bench : count words Date: 22 Mar 2005 14:32:31 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <87vf7n5njs.fsf@code-hal.de> <423f5813$0$9224$9b4e6d93@newsread4.arcor-online.net> <18arnvu705ly4$.1wz6ybz1jt70y$.dlg@40tude.net> <1q9cx4jt7802s.k45m6mcntl87$.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1111519951 22176 192.74.137.71 (22 Mar 2005 19:32:31 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 22 Mar 2005 19:32:31 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:9747 Date: 2005-03-22T14:32:31-05:00 List-Id: Marius Amado Alves writes: > > Text_IO is pretty broken, from both a usability perspective and an > > efficiency perspective. I normally avoid it, and use pragma Import on > > the C routines (open, read, etc). Suitably wrapped in a clean > > interface, of course. > > Bob, would you contribute an efficient Read procedure to this benchmark? You could use OS_Lib.Read. I believe it's portable to non-GNAT Ada compilers, and I believe its license is pretty liberal. I haven't looked at any of these benchmarks. It sounds like this one is measuring speed of text input. Is that intentional? If so, then Text_IO is the appropriate thing to measure, because that's the standard way of doing it in Ada. This is one of the few areas where C is simply better than Ada. Of course, as somebody pointed out, input speed is irrelevant for many programs. But I don't think Ada compilers typically use their own Text_IO to read their input! - Bob