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!news3.google.com!news.glorb.com!tiscali!newsfeed1.ip.tiscali.net!fi.sn.net!newsfeed2.fi.sn.net!feeder2.news.jippii.net!reader1.news.jippii.net!53ab2750!not-for-mail From: Tapio Kelloniemi Subject: Re: Ada bench : count words References: Newsgroups: comp.lang.ada Message-ID: Date: Tue, 22 Mar 2005 16:41:53 GMT NNTP-Posting-Host: 217.30.176.187 X-Complaints-To: newsmaster@saunalahti.com X-Trace: reader1.news.jippii.net 1111509713 217.30.176.187 (Tue, 22 Mar 2005 18:41:53 EET) NNTP-Posting-Date: Tue, 22 Mar 2005 18:41:53 EET Organization: Saunalahti Customer Xref: g2news1.google.com comp.lang.ada:9739 Date: 2005-03-22T16:41:53+00:00 List-Id: Marius Amado Alves wrote: >> 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? And to all other benchmarks which need read... >The speed difference is greater than I thought. Ada (with Text_IO) is >about 10 times slower than the C benchmark. I had forgotten to compile >the C benchmark with -O3. Why not use GNAT.OS_Lib. I think it does not add so much overhead, though it is most likely still a bit slower than libc read. But if that matters, why not use syscall (or is it denied). Also adding pragma Inlines somewhere might give us some juicy nanoseconds in case gcc does not inline everything automatically. -- Tapio