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-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 Newsgroups: comp.lang.ada 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; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1183611222 12.201.97.213 (Thu, 05 Jul 2007 04:53:42 GMT) NNTP-Posting-Date: Thu, 05 Jul 2007 04:53:42 GMT Organization: AT&T ASP.att.net Date: Thu, 05 Jul 2007 04:53:42 GMT Xref: g2news1.google.com comp.lang.ada:16416 Date: 2007-07-05T04:53:42+00:00 List-Id: tmoran@acm.org wrote: > 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. Yes. But at 6 mins/move, is 8 secs enough to search another ply? That's the important time. Since the OP said it might be the difference between searching 10 and 11 plys, that implies 36 secs/ply, so the answer would seem to be no. Actually, Flip is only 1 of the 5 basic operations, and it's all the basic operations that are called 1e8 to 1e9 times per move, so the savings are more like 1.6 secs. A real improvement would be to parallelize the algorithm and run it on a multiprocessor. -- Jeff Carter "Hello! Smelly English K...niggets." Monty Python & the Holy Grail 08