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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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 07:28:04 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.he.net!newsxfer.visi.net!154.32.99.10.MISMATCH!psiuk-p2!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: C/Ada performance comparison Date: Thu, 5 Jul 2001 09:37:14 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9i1qig$36o$1@nh.pace.co.uk> References: <3B3C8E6A.39361C75@labe.felk.cvut.cz> <3B424298.9A7849CF@boeing.com> NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 994340240 3288 136.170.200.133 (5 Jul 2001 13:37:20 GMT) X-Complaints-To: newsmaster@pace.co.uk NNTP-Posting-Date: 5 Jul 2001 13:37:20 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:9471 Date: 2001-07-05T13:37:20+00:00 List-Id: In general, I'd agree. However, there might be cases where this is not true. If, for example, I'm doing a lot of computations in a tight loop over a really large number of iterations, the constraint checking of numeric values might add a considerable overhead. Imagine you write X := X + 1 ; That ought to degenerate to a single add instruction with descent optimization, but if you have to do the computation then check that you have not exceeded the range of X's subtype and possibly do something to raise Constraint_Error, that single instruction can expand to quite a few. Do that in a tight loop a million times or so and you'll see some significant changes in performance. Just for the record, turning off the checks should result in code just as tight as what you'd get from a C compiler for a similar operation. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Jeffrey Carter" wrote in message news:3B424298.9A7849CF@boeing.com... > Tomas Hlavaty wrote: > > Although one of the factors for programs to be equivalent is run-time > checks, I would not expect them to give a factor of 7 difference. > Suppressing Ada run-time checks usually does not reduce run times by > more than about 10%. >