Ok, I found the bug and I have basically ported just enough of the
program over to D to run my performance benchmark - 1000,000 random
games from opening position.
Since D is a cleaned up version of C++, it's easy to port and I'm
trying to write it in pretty much exactly the same style - cutting and
pasting a lot of the code and then fixing it up.
The only difference, and this may make the test slightly unfair, is that
instead of putting the position in a C struct and passing a pointer to
various C functions, I just put everything in a class to make it a bit
cleaner.
I backed out several recent optimizations from the C code for the sake
of apples/apples comparison because the code is cleaner without them.
Some of the optimizations I kept because they were simple or more
algorithmic and I use them in both versions. But I think the code
bases are pretty much the same.
I'm running D without ANY compiler options and it's 3.1 times slower.
I'm keeping my fingers crossed - I'm not sure if this is the same as gcc
with speed optimization off or not but I know that D does more checking
such as for array overflows, etc. So this is kind of a super debugging
mode. (The array checking worked, it caught 2 bugs in the code that
would have probably given me big headaches - one of them a typo.)
So far my experience with D is positive, it's pretty much C with all
the features I really want without all the ugly warts.
D -> no options -> 4378.00 games per second.
C -> current version -> 16398.82 games per second
C -> unoptimized caps -> 14330.75 etc.
C -> unoptimized libs -> 13745.70
I'll see if I can figure out what options turn on all the speed now ...
- Don
_______________________________________________
computer-go mailing list
[email protected]
http://www.computer-go.org/mailman/listinfo/computer-go/