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!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 24 Mar 2005 14:19:47 -0600 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Ada bench : count words References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Thu, 24 Mar 2005 14:19:47 -0600 NNTP-Posting-Host: 67.161.24.234 X-Trace: sv3-Z3dD+mHmLobmC3Zd9CMSZoBXvVjGRNY1moeUdDWOsXmthiIyHa0s4LtHz1YFdHhgI7r1zjCgF803jEA!SRbqpzZ7bUBzYs95OeZt+NMB8wqxSthWHuHP2IJCdEdlFUanWe+avZEDUYLUOg== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:9931 Date: 2005-03-24T14:19:47-06:00 List-Id: > In my (minimal) trial, Dmitry A. Kazakov's >(Message-ID: <1j5jfikipztuc.jx5n2zhbg2np$.dlg@40tude.net>) >appears still faster. I don't understand why, unless Gnat.OS.Lib is >significantly faster than Gnat's Ada.Streams.Read, which seems unlikely. I changed Dmitry's program to use Ada.Streams.Read instead of Gnat.OS.Lib, compiled both with -gnato -gnatp -O3, and the portable version appears notably faster. ie, Gnat.OS.Lib.Read is slower than Ada.Streams.Read. Apparently that's because it spends time deleting CRs from the data. It's more efficient here to read the whole block with Ada.Streams.Read and then add a "when CR" branch to the case statements.