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: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: CRC in Ada? Date: 1997/03/11 Message-ID: #1/1 X-Deja-AN: 224745880 References: <1997Mar2.220652@nova.wright.edu> <1997Mar6.091150.1@eisner> <332491B5.7E7E@netcom.com> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-03-11T00:00:00+00:00 List-Id: Ole-HJ said <> Ah, I was confused by your original post, I did not think you were talking about C there, but about Ada. Byte at a time procesing will always be slower than reading blocks. This is true in C as well as Ada. Given comparable I/O packages, C and Ada are not significantly different here. It is true that Text_IO has a lot of extra baggage that makes doing Get(char) slower than getchar in C, these swimply are not comparble operations. Because of this extra baggage, put there quite deliberately of course, most big Ada programs concerned with efficiency do NOT use Text_IO. It is perfectly possible to do character by character IO using streams in Ada, by reading one character at a time. This certainly does introduce an extra overhead of call levels, but it does not result in a system call per character, as some have suggested. If you want something equivalent to the macroized get_char, that is trivially easily programmed in C on top of stream_IO, perhaps it is a good idea for a standard package -- any student could write it in a few minutes, so it is not exactly rocket science!