Spent a big more time optimizing Gongo and now it's quite a bit faster
than the Java reference bot.
Current standings:
Gongo: 9.5 -10.2k playouts/second
Java refbot: 6.2 - 6.8k
Orego 6.10: 16.5 - 17.2k
Orego is another Go bot written in Java. It's an apples-to-oranges
comparison because it's a different (and smarter) algorithm, but I
figured it's time to set my sights higher.
Gongo is no longer a straight port of the refbot; there's an
additional array to track the number of liberties for each point,
which helps cut down on array accesses of neighbor points. However,
the biggest win was when I ran the profiler with the -hs option and
discovered that 40% of the time was being spent in the random number
generator. (The core generator itself is fast, but doing a 64 bit
divide on a 32 bit CPU is slow.)
Filed a bug for this:
http://code.google.com/p/go/issues/detail?id=390
Current profile:
147 samples (avg 1 threads)
29.93% 29.93% gongo·*board·markSurroundedChain
21.77% 52.38% gongo·*board·makeMove
15.65% 88.44% gongo·*board·playRandomGame
8.84% 12.24% gongo·*randomness·Intn
8.84% 8.84% gongo·*board·wouldFillEye
8.16% 96.60% gongo·*robot·findWins
3.40% 3.40% rand·*rngSource·Int63
1.36% 1.36% gongo·*board·getEasyScore
0.68% 8.16% gongo·*board·hasLiberties
0.00% 96.60% goexit
0.00% 96.60% gongo·*robot·GenMove
0.00% 96.60% mainstart
0.00% 96.60% main·main
0.00% 22.45% gongo·*board·capture
0.00% 0.68% MHeap_LookupMaybe
0.00% 0.68% etext
0.00% 0.68% os·*File·Write
- Brian