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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,9c3a1871d2161925 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-05 07:55:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: C/Ada performance comparison Date: Thu, 5 Jul 2001 16:49:37 +0200 Organization: Adalog Message-ID: <9i1urp$g98$1@s1.read.news.oleane.net> References: <3B3C8E6A.39361C75@labe.felk.cvut.cz> <3B424298.9A7849CF@boeing.com> <9i1qig$36o$1@nh.pace.co.uk> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 994344633 16680 195.25.228.57 (5 Jul 2001 14:50:33 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 5 Jul 2001 14:50:33 +0000 (UTC) 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:9473 Date: 2001-07-05T16:49:37+02:00 List-Id: "Marin David Condic" a �crit dans le message news: 9i1qig$36o$1@nh.pace.co.uk... > 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. > Sure. But don't forget that you can put a pragma suppress in a declare block, so that it will affect only that sequence which is truly critical, and not the 99% of the remaining code. Too often, people think that checks are "on" or "off" for the whole program (which happens if you do that with a compiler option). Ada provides finer granularity. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr