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: mheaney@ni.net (Matthew Heaney) Subject: Re: CRC in Ada? Date: 1997/03/04 Message-ID: #1/1 X-Deja-AN: 223178693 References: <1997Mar2.220652@nova.wright.edu> <331bf6ce.2832564@news.logica.co.uk> Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-03-04T00:00:00+00:00 List-Id: In article <331bf6ce.2832564@news.logica.co.uk>, garriga@logica.com (Stephen Garriga) wrote: > _IF_ you are doing the CRC on a file (as I was), I would advise you >to consider performance. I found (exactly the same algorithm) >implemented in C took an order of magnitude seconds less to execute >than the Ada equivalent. Once again it is necessary to clarify things with respect to languages and efficiency. First, performance is a characteristic of _implementations_, not of _languages_. So let's not be making bold intimations that Ada the language is somehow slower than C. Second, one of the things many Ada programmers don't realize is that strong typing can _increase_ the efficiency because it gives the compiler more semantic information on which to base optimizations. (For example, using a subtype for an array index value can turn off checks that would otherwise be necessary to detect index constraint errors when dereferencing an array.) So show me this algorithm that "is exactly the same" and I'll tell you why it runs more slowly. matt -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271