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: Michael & Amy Hartsough Subject: Re: CRC in Ada? Date: 1997/03/18 Message-ID: <332F5CC8.6D7C@worldnet.att.net>#1/1 X-Deja-AN: 226603225 References: <1997Mar2.220652@nova.wright.edu> <331bf6ce.2832564@news.logica.co.uk> <332B5EBD.3D9E@worldnet.att.net> <332C9185.61C1@worldnet.att.net> Organization: AT&T WorldNet Services Newsgroups: comp.lang.ada Date: 1997-03-18T00:00:00+00:00 List-Id: Robert Dewar wrote: > Michael said > <> > > OUCH! Sequential_IO is intended to be used for logical record I/O. > I can see that one might be tempted to write non-portable code that > (mis)used Sequential_IO in this manner in Ada 83 if you felt compelled > to use the Ada 83 IO packages, instead of the more obvious choice of > using C packages for a case like this (Ada 83 really lacked stream io, > and in a case like this, which is obviously a case for stream io, the > proper response in my view is to interface to C, rather than misuse > the Ada packages). I had been directed to implement CRC32 in Ada 83, and test its output against the output of a C++ version of the algorithm. As soon as testing was completed the CRC32 code (sans file I/O) was lifted out of the test program and inserted into an existing embedded application that reads data from a PCMCIA card. So yes, I DID feel compelled to use an Ada 83 I/O package. I don't think my employer would have much appreciated my spending half a day chasing down some C file I/O routines to improve the throughput of my test program. > It is not at all surprising > that you would see the peformance difference, and it says nothing > about Ada-vs-C performance. Certainly not Ada versus C, but definitely one compiler versus another compiler. Pick your I/O package and your language, and 18 minutes versus 27 seconds to read the same file certainly tells you something. HIS compiler (which happens to be C++) has buffered file I/O. MY compiler (which happens to be Ada 83) does not buffer file I/O. Michael