Terms & Conditions

Internet Magazine

Non–US new players
Get five 2+2 books

Order Books
Book Translations

Expand All   Collapse All

Forum Archives

## The 2+2 Forums

Before using this Forum, please refer to the Terms and Conditions (Last modified: 2/26/2006)

Be sure to read the   Two Plus Two Internet Magazine

This is an archive. The main forums are here

These forums are read only.

 You are not logged in. [Login] Main Index · Search · Classified Ads New user · Who's Online · FAQ · Calendar

Internet Gambling >> Software
 Previous Index Next Flat

Steve Brecher
newbie

Reged: 09/06/04
Posts: 45
Re: 7 Card Hand Evaluators
01/04/07 02:46 PM

Quote:

Just Thought I would put out the entire report for the code:

Thanks for sharing -- very interesting!

On my 3.4G P4:
Validation seconds = 0.6410
Total HighPrecision Clocks = 2201553640
HighPrecision clocks per lookup = 16.455962

In testing order dependence, I found there was indeed none w/r correctness, but there is one w/r timing:

Code:
`// reverse the loop limitsfor (c0 = 52; c0 > 6 ; c0--) {    u0 = HR[53+c0];    for (c1 = c0-1; c1 > 5; c1--) {        u1 = HR[u0+c1];        for (c2 = c1-1; c2 > 4; c2--) {            u2 = HR[u1+c2];            for (c3 = c2-1; c3 > 3; c3--) {                u3 = HR[u2+c3];                for (c4 = c3-1; c4 > 2; c4--) {                    u4 = HR[u3+c4];                    for (c5 = c4-1; c5 > 1; c5--) {                        u5 = HR[u4+c5];                        for (c6 = c5-1; c6 > 0; c6--) {                            handTypeSum[HR[u5+c6] >> 12]++;                            count++;                        }                    }                }            }        }    }}`

Validation seconds = 0.7660
Total HighPrecision Clocks = 2622109016
HighPrecision clocks per lookup = 19.599489

I just ran the tests, and haven't yet looked into why there is a difference.

Separately...
It makes no perceivable timing difference on our reasonably fast hardware, but I hope this thread is not locking us into this benchmark paradigm, e.g.,

for (c0 = 0; c0 < 52; c0++)
for (c1 = c0+1; c0 < 52; c0++)
...
for (c6 = c5+1; c6 < 52; c6++)

rather than

for (c0 = 0; c0 < 46; c0++)
for (c1 = c0+1; c0 < 47; c0++)
...
for (c6 = c5+1; c6 < 52; c6++)

Something in my twisted cycle-saving brain wants to see the latter

 Post Extras

Extra information
0 registered and 10 anonymous users are browsing this forum.

Moderator:  SamIAm, Mike Haven

Forum Permissions
You cannot start new topics
You cannot reply to topics
HTML is disabled
UBBCode is enabled

Rating: