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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9c86eb13dd395066 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: CRC in Ada? Date: 1997/03/08 Message-ID: #1/1 X-Deja-AN: 223981689 References: <1997Mar2.220652@nova.wright.edu> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-03-08T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >I'll tell you what. Go measure the relative speed of reading a 1 meg >file a character at a time, vs using read to read the entire 1 meg at >a time. Do this measurement on at least six different systems. Come >back here with the results and we will discuss them! I think the presumption is that the program needs to look at each character, one at a time. So to make it a fair test, you need to loop through all the characters and do something with them. Preferably something that will prevent optimizing away the whole loop (like add them up and print out the result at the end). The first program should read a character at a time, and do something. The second should read into a giant buffer, and *then* loop through it doing (the same) something. - Bob