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_50,FREEMAIL_FROM, HELO_NO_DOMAIN,MAILING_LIST_MULTI,RDNS_NONE,SPOOFED_FREEMAIL_NO_RDNS autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,25aa3c7e1b59f7b5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-07 08:46:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "Gautier Write-only-address" Newsgroups: comp.lang.ada Subject: Re: A case where Ada defaults to unsafe? Date: Mon, 07 Jan 2002 16:45:50 +0000 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: avanie.enst.fr 1010421962 32501 137.194.161.2 (7 Jan 2002 16:46:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 7 Jan 2002 16:46:02 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: X-Originating-IP: [194.40.39.50] X-OriginalArrivalTime: 07 Jan 2002 16:45:50.0492 (UTC) FILETIME=[C39145C0:01C1979A] Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:18609 Date: 2002-01-07T16:45:50+00:00 > >The short circuit is not always the faster. A good compiler > >can much more aggressively optimize an "x>=0 and x<=xmax" than > >"x>=0 and then x<=xmax"; in addition "and then" introduces > >branch(es) in the machine code, this is a performance > >penalty on processors like the Pentiums. Ted: >Except that processors like the Pentiums also have branch prediction and >speculative execution. So it might not matter much after all. :-) You are speculating, I have tested. BTW I was an "all short-circuit" fan before discovering that it *is* slower for such expressions. G. _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx