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.6 required=5.0 tests=BAYES_05,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9da298537a16487e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-12 06:13:31 PST Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!gatech!udel!news.mathworks.com!panix!cmcl2!thecourier.cims.nyu.edu!thecourier.cims.nyu.edu!nobody From: dewar@cs.nyu.edu (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Run-time checking and speed Date: 12 Jan 1995 09:13:31 -0500 Organization: Courant Institute of Mathematical Sciences Message-ID: <3f3deb$4us@gnat.cs.nyu.edu> References: <3ev16u$ojc@pong.lasc.lockheed.com> <3f0prq$3bq@theopolis.orl.mmc.com> NNTP-Posting-Host: gnat.cs.nyu.edu Date: 1995-01-12T09:13:31-05:00 List-Id: T.E.D. says "As for constraint checks, try to leave them in until your product is THOROUGHLY debugged. They are worth their weight in gold during the debugging phase." I would be stronger, I would say leave them in for the production code. Knuth once said that removing checks for the production code is like using life-jackets for training outings, and then leaving them at home for the final trans-atlantic sailing on the grounds that they add too much weight. Of course in some cases, the delivered code does not run fast enough, and you have to cut corners to meet processing efficiency requirements, and in this situation you may have to abandon the checks, but do this only when you have to, not as a matter of course. I have seen too many Ada environments in which the assumption is that checks will be turned off for production code. The penalty of run time checks can run anywhere from 5-50% depending on the code. Enthusiastic vendors will tell you that it is never more than 10%, but that depends very much on your code and it may be higher. But suppose that it is 20%. It is amazing how many programs really don't care about 20%, and it is often the case that next months version of the processor chip will make up the 20% anyway. Don't get me wrong, I quite appreciate that there are situations, particulary embedded situations with critical deadlines running on junk old hardware, where processing deadlines are indeed very pushed, and there may be some general applications where speed is pushed (a one day weather forcasing program that takes 2 days to run is not much use to anyone :-) So I quite appreciate that checks must be turned off in some cases, I just argue that this should not be the default assumption. Another situation where it is quite appropriate to turn off run time checks is in verified safety critical code where part of the verification ensures that the checks are not needed. You have to be *very* sure of your verification technology to depend on this!