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-Thread: 103376,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!tethys.csu.net!nntp.csufresno.edu!sn-xit-02!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: CTips Newsgroups: comp.lang.ada,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: Sat, 12 Mar 2005 08:56:37 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <1135t9id2cpip06@corp.supernews.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <112rs0bdr2aftdf@corp.supernews.com> <1inxxr988rxgg$.1w9dedak41k89.dlg@40tude.net> <112s1r0rf0o8nca@corp.supernews.com> <112sonip5v4dca6@corp.supernews.com> <112t3de6fu04f38@corp.supernews.com> <422ee0ce$0$1091$9b4e6d93@newsread2.arcor-online.net> <112v9p788s1684d@corp.supernews.com> <42307820$0$26539$9b4e6d93@newsread4.arcor-online.net> <1132e5g2cor3oe2@corp.supernews.com> <42329994$0$1093$9b4e6d93@newsread2.arcor-online.net> In-Reply-To: <42329994$0$1093$9b4e6d93@newsread2.arcor-online.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@supernews.com Xref: g2news1.google.com comp.lang.ada:9232 comp.realtime:1364 comp.software-eng:4925 Date: 2005-03-12T08:56:37-05:00 List-Id: Georg Bauhaus wrote: > CTips wrote: > >> Georg Bauhaus wrote: >> >> >>> Done. You might be disappointed by the results. In short: >>> < 1%, < 3%; and < 8% for a different program, really. >> >> >> >> I'm not disappointed at all, in fact the numbers are way worse than I >> expected, [...] > > >> You have to be *very* careful that what you're measuring isn't hidden >> behind some other effect. > > > I admit that I was measuring relative performance of a program > written in two programming languages. And I didn't want to write > a benchmark program; how useful, well-defined, etc. are they. > > Out of curiosity, if a 1.03x slowdown is far worse than expected, > than what is a not-so-bad slowdown that would make you say o.K. > to checks? I'm not certain about the question. What I had expected when I specified the problem was about 20-30% slowdown. When I saw your array sizes, I expected a 0% slowdown - all the extra checking should have been hidden in the shadow of the L2 load miss. If you're asking how much slowdown is acceptable (i.e. how much would I be willing to pay for extra checking), it will vary from application to application. On some of the stuff I do, no overhead at all is acceptable. On others, well, things need to run fast, but its acceptable to trade-off performance for ease-of-modification. As for automatically or manual checking - I add a lot of checking code to my programs [see http://users.bestweb.net/~ctips ]. However, I do try to follow a few rules: - The checking code can be disabled via a compile-time flag - Enabling/disabling checking code does not change the memory layout of objects. Ada, I believe, violates the second rule. If you disable bounds checking, it will replace handles with straight pointers, which can result in considerably different memory images. Another problem with automatic checking is that it can only check for a few things. For instance, consider a list ADT: struct list { struct list * next; T value; }; struct list * merge_list(struct list *, struct list *); ... In this case, one of the checks I add is "this list is non-circular". This has to be added manually.