Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Move Generation

Author: Tord Romstad

Date: 07:47:18 02/24/05

Go up one level in this thread


On February 24, 2005 at 04:58:05, Dieter Buerssner wrote:

>On February 23, 2005 at 13:47:30, Tord Romstad wrote:
>
>>8 percent?  Are you sure?  On my profiler outputs, the is_check() and is_legal()
>>functions are so far down the list that I have never even noticed them.
>
>Tord, are you sure, that your is_check() type functions are not inlined?

Yes, I am sure.  I compile with gcc, which cannot do inlining across
different source code files.  The definition of the is_check() function
is in a different file from where it is called.

>To me, 8 percent does not sound extremely much. With "so far down the list" I
>assume you mean something like ~1% or smaller.

Yes.  I checked now, and the number was 0.8% in a highly tactical middle
game position.  It is probably even lower for non-tactical positions.

Perhaps the is_check() function is the only part of my program which isn't
horribly inefficient.  :-)

>How often do you call incheck, say compared to make_move?

Surprisingly often, it seems.  My profiler claims that is_check() was called
43,440,299 times, while make_move was called 29,700,615 times during the
5 minutes I let the program think before inspecting the profiler output.
I guess the is_check/make_move ratio would be much smaller in a non-tactical
position.

>IIRC my engine used considerably more than 1%, perhaps
>close to the 8%. Basically incheck, make_move, unmake_move,
>generate_moves/captures used comparable amount of time. Of course it depends on
>some tricks mentioned here (that I have now, and I did not have them years
>back). Overall those tricks do not save a lot and make code more complicated and
>prone to errors. So perhaps not a good suggestion for a fresh engine.

I agree 100%.  My own engine is still too fresh to bother with any complicated
tricks just to save a tiny amount of time.  I prefer to keep the code as
compact, simple and straightforward as possible.  There are very few
clever tricks to be found in my code, and none at all in my is_check()
function.

Tord



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.