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: Jim Balter Subject: Re: CRC in Ada? Date: 1997/03/10 Message-ID: <3324A613.812@netcom.com>#1/1 X-Deja-AN: 224529760 References: <1997Mar2.220652@nova.wright.edu> <331d3cf9.1190126@news.logica.co.uk> <1997Mar5.083233.1@eisner> <1997Mar5.131846.1@eisner> <5fmo1k$adm@mulga.cs.mu.OZ.AU> Organization: JQB Enterprises X-NETCOM-Date: Mon Mar 10 6:25:52 PM CST 1997 Newsgroups: comp.lang.ada Date: 1997-03-10T18:25:52-06:00 List-Id: Robert Dewar wrote: > > Fergus said > > < times is so large, but I'm more surprised by the speed of the second > version than by the slowness of the first.>> > > Well it does not surprise me, and I don't really understand why it > surprises you. I would expect a large difference here, and indeed > it is what we see! > > Just shows that measurements can be a useful substitute for guesswork, > though measurements have the weakness of being system specific, so > nothing really substitutes for a lot of experience on a lot of difrerent > machiens! These measurements are totally misleading, and their use and interpretation show a total *lack* of experience. If the tests are coded properly so that the buffer accesses aren't optimized out of existence, you will see about a 3:1 difference in user cpu time between the getchar version and the read version, solely as a consequence of the getchar macro requiring more instructions. Exactly the same number of system calls are made, as anyone who attempts to *understand* the issue instead of indulging in silly sophistry will know. If you then do, say, 20 instructions worth of processing per character, the ratio is 23:21. *Big* difference, like you'd expect. Feh. --