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,5ff6e0c3de8331c0 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!193.252.118.146.MISMATCH!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Message-ID: <468BF21C.7040708@obry.net> Date: Wed, 04 Jul 2007 21:16:44 +0200 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 Newsgroups: comp.lang.ada To: tmoran@acm.org Subject: Re: sub-optimal code for packed boolean arrays -- bug or inherent limitation References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 04 Jul 2007 21:16:51 CEST NNTP-Posting-Host: 81.249.125.101 X-Trace: 1183576611 news.orange.fr 5072 81.249.125.101:2349 X-Complaints-To: abuse@orange.fr Xref: g2news1.google.com comp.lang.ada:16413 Date: 2007-07-04T21:16:51+02:00 List-Id: tmoran@acm.org a �crit : > Using -O2 with the old gnat 3.15p on a 3GHz dual core Pentium (but only > programming to use one core) under W2k, I find that the versions with > B(I) := not B(I); > and > B(I) := B(I) xor True; > take about 14 nanoseconds, while the version with > One(i) := True; > B := B xor One; > takes about 6. With 1e9 calls, that's an 8 second difference. That's not a proper timing. 3.15p is using a very old backend (2.x if my memory is good). Since then there have been two major versions of the GCC backend, both bringing better optimizations. It would be better to do the measurement with GCC/FSF 4.2 or GNAT GPL 2007. Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595