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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9c3a1871d2161925 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-05 03:55:29 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sjc-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!kilgallen From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: C/Ada performance comparison Message-ID: References: <3B3C8E6A.39361C75@labe.felk.cvut.cz> <3B424298.9A7849CF@boeing.com> <3B4351F9.D901BEEC@ACM.org> <3B44135F.90D9711A@ACM.org> Organization: LJK Software Date: 5 Jul 2001 06:55:26 -0500 NNTP-Posting-Host: 216.44.122.34 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 994330528 216.44.122.34 (Thu, 05 Jul 2001 10:55:28 GMT) NNTP-Posting-Date: Thu, 05 Jul 2001 10:55:28 GMT Xref: archiver1.google.com comp.lang.ada:9458 Date: 2001-07-05T06:55:26-05:00 List-Id: In article <3B44135F.90D9711A@ACM.org>, Colin Paul Gloster writes: > Samuel Tardieu wrote: "On 4/07, Colin Paul Gloster wrote: > > | A factor of 7 implies that the programs are not equivalent. [..] > > A typical example of that non-equivalence is a user not turning > off exception > checks. An Ada program with exceptions is not the equivalent of a > C program > without them." > > I do not know of anyone who claimed that an Ada program with > exceptions is equivalent to a C program sans them. I did say that > an equivalent Ada83 program wherein the C and Ada83 versions > use dynamic memory can hog a lot more memory than the C > version. So far as we know, Tomas Hlavaty's Ada source has no > such thing as exception handling. An Ada and a C program can be > equivalent and that Ada(95, and 83) has better optional features which > would impact performance does not mean that an equivalent program > has to use similar resource levels to the C original. The factor of seven > may hint that exceptions are used but a hint is not a proof. Exception checks do not require any specific invocation in the source. On some processors, there are no hardware functions to detect certain exceptional conditions, so an Ada compiler will generate extra code to check for such conditions and raise and exception if necessary. I don't think there are any processors with hardware functions to achieve array bounds checking, so things like that will always be in generated Ada code (unless you run the Ada compiler in a mode to turn them off).