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!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s22.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: <1183404856.375083.160890@q69g2000hsb.googlegroups.com> <1183485842.725620.199490@w5g2000hsg.googlegroups.com> In-Reply-To: <1183485842.725620.199490@w5g2000hsg.googlegroups.com> 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_s22 1183487791 12.201.97.213 (Tue, 03 Jul 2007 18:36:31 GMT) NNTP-Posting-Date: Tue, 03 Jul 2007 18:36:31 GMT Organization: AT&T ASP.att.net Date: Tue, 03 Jul 2007 18:36:31 GMT Xref: g2news1.google.com comp.lang.ada:16400 Date: 2007-07-03T18:36:31+00:00 List-Id: Alinabi wrote: > > Now, concerning efficiency: these basic operations on bitboards > are used 1e8 to 1e9 times every time the program tries to decide > what to move next. Even the smallest improvement in speed can > mean the difference between searching 10 or 11 ply deep, which > can mean an improvement of over 50 Elo points in strength. I'm sure that's true. However, you have not demonstrated that there's a speed difference between the 2 versions. Even if there is, it doesn't necessarily mean that there will be a difference in the # of plys that can be searched. The old rule, "1st get it right, then make it fast," still applies. Once you have it finished you can easily see if modifying this single procedure actually makes a difference. Until then, you're wasting a lot of effort on something you don't know is important. You should also be aware that you're sending the compiler conflicting messages. Packing the array indicates that you want the compiler to minimize storage, even at the expense of speed, while "pragma Optimize (Time);" indicates that you want to minimize time, even at the expense of storage. Obtaining speed often requires wasting storage; the fastest implementation might be to not pack the array. I don't know how many of these you have, but with the large memories on modern machines, you might be better off with the additional 56 bytes per array. Again, you won't know for sure until you have a working version you can measure. -- Jeff Carter "Gentlemen, you can't fight in here. This is the War Room!" Dr. Strangelove 30