[computer-go] Some beginner's questions concerning go bots

Don Dailey drdailey at cox.net
Sun May 11 06:43:49 PDT 2008


Hi Carter,

D is very interesting and I've written some code with it and gotten to 
know it a bit.    I'm close, but not quite ready to take the plunge of 
using it as my primary high performance language.     Although there are 
claims about it being the same in speed as C or C++  I have found it to 
be roughly 35% slower for programs coded in the same fashion.     On the 
other hand, it probably has the potential to be faster than C once it 
matures.

D is basically C or C++ cleaned up significantly and with higher level 
features such as garbage collection and iterators and it's really a joy 
to use - and if you know C you will be comfortable right away with D.  

D is low level which is the appeal for me.   You can use it right along 
with C, link in the object files with very little trouble.   All the 
data types are the same.     For instance if you want that 30% I talked 
about you can write the core engine in C but do the  hard stuff in D.   

The big issue with Java is memory.    I cannot see building a high 
performance program that makes sophisticated use of lots of memory.      
I think you could build a small fairly high performance program in Java, 
but modern Monte Carlo programs would be serious  memory hogs  with 
Java.     When several of us tested Mogo in the big scalability study,  
memory was a big issue EVEN though it was written in C (or C++.)     The 
issue was that Mogo allocates a certain fixed number of nodes to the UCT 
tree contained in memory and when you run Mogo at a high level,   these 
nodes are exhausted.   Mogo compensates by pruning and re-using certain 
nodes, but there is likely some performance loss.   

This of course is not an issue confined to Mogo, but all the high 
performance MC programs need to deal with the same issues since the 
current techniques build as much of the game tree in memory as possible. 

I don't want to start a flame war, but I think performance is an issue 
with Java too.    It's true that you can write some programs that are 
very fast in Java,  even comparable to C,  but you definitely lose the 
low level flexibility of C.   It makes it harder to shoot yourself in 
the foot but it still limits your performance.    Of course you can 
always pick and choose your benchmarks to find one that verifies the 
conclusions you want to believe in,  but I believe you will ALWAYS be 
able to write high performance code in C (even if it's ugly) but with 
Java you will only be able to write some high performance code.   (This 
is rather analogous to assembly vs C,   no restrictions in assembly so 
there are still a few corners where you cannot get all the speed out of 
C - it's even more-so with high level languages such as Java.  But I 
believe D doesn't suffer any more than C and is probably even more 
optimizable,  although the compilers are not there yet.)

The only feasible choice that I can imagine currently is C, C++ or D for 
super high performance programs.    I personally would consider D a much 
better choice than Java if you are looking for something higher level 
than C and C++ and don't mind taking a small performance hit.     It 
seems likely to me that the performance hit of D will go away in time 
but I'm not a prophet.     This is claimed of Java, but I don't believe 
it will every be true in general, although it will probably be true in 
specific cases. 

Of concern is 64 bit support in D.   I don't know where that is now.    
I'm still using C but I'm keeping a close eye on D.

- Don







Carter Cheng wrote:
> Thanks for the responses.
>
> 1) I guess for this seki question I was wondering if it was as easy to define as liveness without seki. The reason I am interested in this is I am curious about absolutely correct scoring functions and whether they currently cope well with advanced seki situations or not. I have been looking at some of the cases listed on the Sensei's Library. A cursory look seems to indicate that they are very difficult to classify- and any seki classifier might need some knowledge of killing shapes.
>
> 2) You are correct Jason I transposed the symbols for some reason I actually meant 3^(n^2) but typed it in backwards. 
>
> 3) Also thanks for the links. I have taken a look at some of the code. I am not sure I will be writing in Java or D and most likely will be implementing the system in something like C++. I am worried about Java's speed since it's interpreted (which still means a x2 slowdown even with the JIT and Hotspot compilation and selective inlining). D I am just not too familiar with I am wondering what advantages it brings over C++. I am primarily concerned about maturity issues. I am not trying to start a discussion on which language is "better", but those are my initial impressions.
>
> I am primarily interested in creating a very basic go bot at this point and use it for primarily data gathering. I have been curious about certain aspects of game searches and how they apply to go and how reinforcement learning works etc. I figure being a complete beginner at this it will take some time before I have any meaningful insights into how everything works to contribute anything. 
>
> Regards,
>
> Carter.
>
>
>
>
>
>
>
>       ____________________________________________________________________________________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> _______________________________________________
> computer-go mailing list
> computer-go at computer-go.org
> http://www.computer-go.org/mailman/listinfo/computer-go/
>
>   


More information about the computer-go mailing list