Speed vs ELO gain

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

jacobbl
Posts: 80
Joined: Wed Feb 17, 2010 3:57 pm

Speed vs ELO gain

Post by jacobbl »

I've programmed my engine "Sjakk" in Visual Basic (Express 2010). This is quite a slow language without support for inline statements, and I don't get any speedup when I compile it to 64 bit (not even on the move generation where I use bitboards). My engine on a 2.00 GHz computer does about 100 K N/S and the move generator (perft testing) does about 700 KN/S. This is very slow compared to the engines I compete with so I'm wondering if I should convert it to C. But I haven't programmed C in about 15 years so it will be a lot of hard work. But still if I could get a really large speed gain (some say 2-4 times) it might be worth it.

Is there a simple rule of thumb on how much ELO gain one gets for doubling the speed?

Regards
Jacob
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Speed vs ELO gain

Post by Desperado »

jacobbl wrote:I've programmed my engine "Sjakk" in Visual Basic (Express 2010). This is quite a slow language without support for inline statements, and I don't get any speedup when I compile it to 64 bit (not even on the move generation where I use bitboards). My engine on a 2.00 GHz computer does about 100 K N/S and the move generator (perft testing) does about 700 KN/S. This is very slow compared to the engines I compete with so I'm wondering if I should convert it to C. But I haven't programmed C in about 15 years so it will be a lot of hard work. But still if I could get a really large speed gain (some say 2-4 times) it might be worth it.

Is there a simple rule of thumb on how much ELO gain one gets for doubling the speed?

Regards
Jacob
Hello Jacob,

well that will depend on the Effective Branching Factor
(http://chessprogramming.wikispaces.com/Branching+Factor)
your engine has. if the ebf is about 2 you gain one ply by doubling the speed,
which is worth _around_ 50 elo. just as _simple_ rule.

Michael
jacobbl
Posts: 80
Joined: Wed Feb 17, 2010 3:57 pm

Re: Speed vs ELO gain

Post by jacobbl »

Is this linear or is the ELO gain larger at smaller depths (i.e is the gain greater from ply 7 to 8 than from ply 17 to 18)?

Regards
Jacob
smatovic
Posts: 2645
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

write in c

Post by smatovic »

this reminds me of a song ;-)

http://www.youtube.com/watch?v=XHosLhPEN3k

...have choosen from the beginning C as programming language,
my first attempt, an 12x10 Mailbox approach achieved ~ 300knps,
with my new Bitboard Design i get ~ 500 knps on 32 bit and ~1000knps on 64 bit machines,
want to add that my engine is not optimized for 32 bit.

--
Srdja
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Speed vs ELO gain

Post by Gerd Isenberg »

jacobbl wrote:Is this linear or is the ELO gain larger at smaller depths (i.e is the gain greater from ply 7 to 8 than from ply 17 to 18)?

Regards
Jacob
Ernst A. Heinz (2001) found indications of decreasing returns from increasing search in chess:
* 12-ply was 84 ELO points better than 11 ply
* 11-ply was 92 ELO points better than 10 ply
* 10-ply was 115 ELO points better than 9 ply

https://chessprogramming.wikispaces.com ... %20Returns
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Speed vs ELO gain

Post by Dann Corbit »

jacobbl wrote:I've programmed my engine "Sjakk" in Visual Basic (Express 2010). This is quite a slow language without support for inline statements, and I don't get any speedup when I compile it to 64 bit (not even on the move generation where I use bitboards). My engine on a 2.00 GHz computer does about 100 K N/S and the move generator (perft testing) does about 700 KN/S. This is very slow compared to the engines I compete with so I'm wondering if I should convert it to C. But I haven't programmed C in about 15 years so it will be a lot of hard work. But still if I could get a really large speed gain (some say 2-4 times) it might be worth it.

Is there a simple rule of thumb on how much ELO gain one gets for doubling the speed?

Regards
Jacob
This can help:
http://msdn.microsoft.com/en-us/library/6t9t5wcf.aspx

But C or C++ will still be faster.

You will get a lot more boost from reducing your branching factor than from speeding up your move generation.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Speed vs ELO gain

Post by Joost Buijs »

jacobbl wrote:I've programmed my engine "Sjakk" in Visual Basic (Express 2010). This is quite a slow language without support for inline statements, and I don't get any speedup when I compile it to 64 bit (not even on the move generation where I use bitboards). My engine on a 2.00 GHz computer does about 100 K N/S and the move generator (perft testing) does about 700 KN/S. This is very slow compared to the engines I compete with so I'm wondering if I should convert it to C. But I haven't programmed C in about 15 years so it will be a lot of hard work. But still if I could get a really large speed gain (some say 2-4 times) it might be worth it.

Is there a simple rule of thumb on how much ELO gain one gets for doubling the speed?
As a rule of thumb I always use 70 ELO for a speed doubling. It will also depend upon how fast your engine already is. Slow engines will probably gain more.

700 kN/S perft is incredibly slow, this can't be the compiler alone, maybe there are some algorithmic bottlenecks as well. For instance my engine runs perft at ~28000 kN/S on a single 3.3 GHz. core. This is with full fledged do_move() and undo_move().
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Speed vs ELO gain

Post by hgm »

It depends on what you count as nodes. If a node is defined as a move generation your perft speed would probably be quite a bit lower.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Speed vs ELO gain

Post by Joost Buijs »

hgm wrote:It depends on what you count as nodes. If a node is defined as a move generation your perft speed would probably be quite a bit lower.
What I mean with a node is generate the move, do the move on the board and undo the move on the board.
When I would just count the number of moves generated at the leaves of the tree it would be quite a lot faster than it is now.
Laszlo Gaspar
Posts: 64
Joined: Thu Mar 09, 2006 11:07 am
Location: Budapest, Hungary

Re: Speed vs ELO gain

Post by Laszlo Gaspar »

jacobbl wrote:I've programmed my engine "Sjakk" in Visual Basic (Express 2010). This is quite a slow language without support for inline statements, and I don't get any speedup when I compile it to 64 bit (not even on the move generation where I use bitboards). My engine on a 2.00 GHz computer does about 100 K N/S and the move generator (perft testing) does about 700 KN/S. This is very slow compared to the engines I compete with so I'm wondering if I should convert it to C. But I haven't programmed C in about 15 years so it will be a lot of hard work. But still if I could get a really large speed gain (some say 2-4 times) it might be worth it.

Is there a simple rule of thumb on how much ELO gain one gets for doubling the speed?

Regards
Jacob
Hi Jacob,

I have a very different opinion on this. In my tests Stockfish on 50% strength reached ~120elo less in both 1 minute and 3 minute games.

My other experiments with my weaker engine also confirmed that every 1 percent boost gave 1 elo strength increase at least.

Others should confirm this with their own tests.
Regards,
László