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: ohk@edeber.tfdt-o.nta.no (Ole-Hjalmar Kristensen FOU.TD/DELAB) Subject: Re: CRC in Ada? Date: 1997/03/07 Message-ID: #1/1 X-Deja-AN: 223718634 References: <1997Mar2.220652@nova.wright.edu> <1997Mar5.083233.1@eisner> Organization: Telenor Online Public Access Newsgroups: comp.lang.ada Date: 1997-03-07T00:00:00+00:00 List-Id: In article dewar@merv.cs.nyu.edu (Robert Dewar) writes: Bob Duff said <> It can, but be careful. If you write String'Input, then not only do you get the overhead of going character by character, unless a lot of special optimization is at work, but you also get the general inefficiency of dealing with unconstrained variable length objects, which usually involves at least one extra copy. The character by character reads come from the fact that this is the semantics of String'Input. yes, it could indeed be optimized (in the normal case, where a user level attribute is not supplied for type character), but you cannot count on that. More likely to be efficient is using Read and Write directly on buffers of stream elements. Indeed it is perfectly easy, and probably safest to do your own buffering in many cases (the same advice applies to C, it may be efficient to do indidvidual getchar's, but it may also be a disaster from an efficiency point of view. It may certainly be less effective, but I cannot think of any implementation where it would be a disaster. The C single char IO operations are not complicated, and have very little overhead. What makes you think otherwise?