Moderator: Andres Valverde
Pradu wrote:Also I'm not quite sure if Java engines can be Winboard compatable.
Jonatan Pettersson wrote:I might consider rewriting it in C then. But as you said the ease of programming in Java makes the basic features easier to handle, beginner as I am to chess engines.
Gian-Carlo Pascutto wrote:Are there any benchmarks of C# vs. Java for computational speed?
I don't think choosing a language for easier later porting to another one makes sense.
Jonatan Pettersson wrote:Hi, new to these forums.
I've been writing an engine for the passed couple of months and chose Java due to other considerations than speed.
I was wondering how these two languages compare in speed. I realize C should be faster since it doesn't require the Java-'translation'.
I've no real intention of writing a super fast engine, and I don't need exceptional speed.
But how much of a difference is there? And is Java reasonable?
Volker B?hm wrote:For a long time Spike could be compiled with both C++ and a Java compiler. We mesured, that C++ is about 60% faster (thus making 160 nodes where Jave made 100) than the Java engine. This is only true, if you are using a good Java virtual machine; look for one that is optimizes for Server programs, or one that as a server option. I think there is one from IBM. The most client based Java jit Compiler only get half the speed than the C++ version.
Most cases are handled equally well by the java compiler (jit) as by the c++ compiler. The speed difference comes mainly from the bounds checking of array access that can?t be deactivated in java.
You can get java run with winboard and UCI, Ralf Sch?fer (for an e-mail look at the home page of Spike) has some experiences with it.
Greetings Volker
Volker B?hm wrote:Hi Vincent,
we where a little confused about the results too. Maybe its the architecture of Spike that makes it run very fast in Java.
My C++ programmin skill may not be the best ever seen, but I am a "optimization" fan and I have been writing Intel assembler programs since the existance of the 8086. Many parts of Spikes code is hand optimized c++ until the assembler code looks like I liked it to.
Surely algorithmic speed-improvements are possible for Spike, but they will have an advantage for Java Speed too.
Greetings Volkerdiepeveen wrote:You know, you just started C++ programming.
It'll get a lot faster in C++ if you learn a tad more.
There is several authors who are in C++ now who i helped speed up their C++ code. Several of them speeded up factor 3.
Vincent
Volker B?hm wrote:For the loop invariant sum of of aDiff + aDirBit, you are not right. Usually it is better to let the compiler decide where to put the invariant code (He is well capable to detect it). In this special case the use of a additional Variable to calculate the sum outside the loop is mesurable slower because of register handling.
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 36 guests