when I was migrating my chess engine Olithink, written in C, (http://brausch.org/home/chess/) to Java about a decade ago, I didn't expect much.
The more I was surprised about the fact, that the Java version had about 50% if the speed of "C".
If it's not enough, the numbers shifted again. Analyzing this tactical position, with Qd3 winning:
[d]6k1/5p1p/P1pb1nq1/6p1/3P4/1BP2PP1/1P1Nb2P/R1B3K1 b - - 9 9
OliThink 5.4.5, both Java and C, found the move on ply 16 with about 190 million nodes:
C:
Code: Select all
16 282 4003 190190289 g6d3 g1f2 e2f3 d2f3 f6e4 f2e1 e4c3 b2c3 d3c3 e1f2 c3a1 c1g5 a1a6 g5f4 d6f4 g3f4 a6d3 b3a2
Code: Select all
16 282 5232 190190289 g6d3 g1f2 e2f3 d2f3 f6e4 f2e1 e4c3 b2c3 d3c3 e1f2 c3a1 c1g5 a1a6 g5f4 d6f4 g3f4 a6d3 b3a2
Thus Java is hardly faster than C.
Isn't this surprising?