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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bb7cc916bd63ab43 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!s9g2000prg.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Performance of element access in Vector Date: Wed, 21 Jan 2009 01:15:14 -0800 (PST) Organization: http://groups.google.com Message-ID: <97268050-5091-4428-8b48-faf5a14eda25@s9g2000prg.googlegroups.com> References: <0a8baaf0-19f7-40c0-a041-884e93fa7020@w39g2000prb.googlegroups.com> NNTP-Posting-Host: 128.141.45.219 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1232529314 18005 127.0.0.1 (21 Jan 2009 09:15:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 21 Jan 2009 09:15:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s9g2000prg.googlegroups.com; posting-host=128.141.45.219; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3463 Date: 2009-01-21T01:15:14-08:00 List-Id: On 21 Sty, 00:01, "Randy Brukardt" wrote: > Maybe it is possible to avoid undefined behavior, but only if you (the > programmer) never makes mistakes. I don't think such a programmer exists. Can you show a realistic example of such a mistake? I'm asking, because I don't remember having this problem. > The containers in Ada are designed to be safe; that necessarily requires > giving up a bit of performance. The problem here is that the compiler does not inline Update_Element/ Query_Element callbacks. Safety and performance are not in conflict here, it is just a quality of implementation issue. You can have both. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada