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: tarjeij@ulrik.uio.no (Tarjei Jensen) Subject: Re: CRC in Ada? Date: 1997/03/10 Message-ID: <5g157e$pqf@ratatosk.uio.no>#1/1 X-Deja-AN: 224396643 References: <1997Mar2.220652@nova.wright.edu> <1997Mar5.131846.1@eisner> Organization: University of Oslo, Norway Newsgroups: comp.lang.ada Date: 1997-03-10T00:00:00+00:00 List-Id: >In article <33206340.2616@bix.com> Tom Moran writes: > > The original message in this thread did not say "reading a file a > character at a time is slow", but rather that doing it in Ada was an > order of magnitude slower than doing it in C, on the same OS and > hardware. Since there is no other way strictly in Ada to read a file > which is too large for memory and whose size is a prime number, this is > unfortunate. And saying Ada 95 can do it by calling a C function, is > less than a strong endorsement of Ada. > The usual explanation is that the C standard library buffers I/O while many other languages does not have that requirement. If Ada required that the stream I/O libraries had to support buffering then Ada would probably be as fast as C for single character I/O. The slowness of Ada is probably because each read triggers an system call which reads a single character. Good example: use Turbo Pascal under MSDOS and experiment with the buffer size for the same program. Differences are dramatic. Greetings, -- // Tarjei T. Jensen // tarjeij@ulrik.uio.no || fax +47 51664292 || voice +47 51 85 87 39 // Support you local rescue centre: GET LOST! // Working, but not speaking for the Norwegian Hydrographic Service.