Monday, January 14, 2008

64-bit speedups

I tried to find out how much performance increase a 64-bit compile will give compared to the 32-bit compile. I tested three different programs: my Connect 4, Cake and KingsRow. I also have a speedup reported by Ed Gilbert for his international checkers program, KingsRow-10. Here are the numbers:

  • KingsRow: 5.8%
  • Cake: 6.4%
  • Connect 4: 11.6%
  • KingsRow-10: 42.9%

This list shows that all programs are able to benefit from the 64-bit compile, although the gain is rather moderate for all programs except KingsRow-10. Why can some programs benefit more than others? Probably this has to do with how much they make use of 64-bit operations. For example, my Connect 4 program uses a 64-bit representation of the board. KingsRow and Cake use 32-bit representations and don't really have any use for the larger word size on the 64-bit machine. KingsRow-10 on the other hand also uses 64-bit numbers for its board representation and benefits much more than any other program on the list.

With all these numbers I have to add that there are some points to be considered: The KingsRow 32/64-bit versions don't seem to search the exact same tree - in kN/s searched, KR-64 was 5.8% faster, but its search time was only 2.6% lower. Additionally, KR wasn't using the endgame database during this test, since it doesn't recognize it for some reason on my system. Cake 32/64 searches exactly the same number of nodes on the one-minute search I used for this test. Cake32 makes use of some assembler instructions which Cake64 does not, so probably the speed difference would be a bit larger if I found out how to program these functions in 64-bit assembler. The same is true for Connect 4 (For the experts: I don't have a LSB function in assembler for the 64-bit versions).


Ed Gilbert said...

> For the experts: I don't have a LSB function in assembler for the 64-bit versions.

Martin, the functions you are looking for are _BitScanReverse64() and _BitScanForward64().

-- Ed

Martin Fierz said...

Hi Ed,

thanks for the tip - I will be trying this...


elisaul said...

Hey Mr. Fierz is there someting stronger thatn Kingsrow 10 db?? Please head down to yahoo checkers there are alot of programmers there with alot of good programs. Just wondering if you might be intrested.

Martin Fierz said...

Hi elisaul,

I think there is nothing stronger than KingsRow 10pc!