Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Playing the NPS game

Author: Robert Hyatt

Date: 19:28:06 09/26/01

Go up one level in this thread


On September 26, 2001 at 18:35:24, Gian-Carlo Pascutto wrote:

>On September 26, 2001 at 17:45:45, Robert Hyatt wrote:
>
>>On September 26, 2001 at 17:11:29, Gian-Carlo Pascutto wrote:
>>
>>>On September 26, 2001 at 16:18:21, Bruce Moreland wrote:
>>>
>>>>It sounds like you need to spend some quality time with your profiler.  It's
>>>>possible that you are doing one dumb thing, and you can just fix that and go
>>>>like blazes.  It's more likely, with a pretty new program, that everything is
>>>>slow, but at least you can figure out what the slowest thing is and fix it.
>>>>
>>>>bruce
>>>
>>>Some profiling data:
>>>
>>>mid_eval:          24%
>>>is_attacked:       12%  (is called in eval for kingsafety)
>>
>>That seems like a waste, but maybe not.  IE There are other ways to evaluate
>>king safety besides testing if it is attacked using that much CPU time..
>
>I realize. I use attack testing as follows:
>
>a) do we have a fianchetto hole? does the opponent have the 'good' bishop? do
>we have it? is the weak square attacked?
>
>b) are two or more squares in front of the king attacked?
>
>(a) isn't done much. I added (b) to add some awareness of setups
>with bishops + queens all aiming onto the position.
>
>>Here is what mine looks like for a test I just ran for comparison:
>>  %   cumulative   self              self     total
>> time   seconds   seconds    calls  ms/call  ms/call  name
>> 25.12     73.94    73.94 38414441     0.00     0.00  Evaluate
>>  7.33     95.53    21.59 45334984     0.00     0.00  MakeMove
>>  6.84    115.66    20.13     1999    10.07   123.81  Search
>>  5.28    131.20    15.54 45334984     0.00     0.00  UnMakeMove
>
>What's interesting to note here is that movegen appears below
>making/unmaking moves. Also SEE seems much cheaper for you. I
>know crafty uses some tricks to not do SEE sometimes but when
>I removed them (in crafty) it broke even and when I add them
>in my program they hurt, so it's a no-go.
>
>>>movegen:           11%
>>>SEE:               10%
>>>search:             6%
>>>
>>
>>Where is the rest of the time?
>
>The next function up was quiescent hash probing, which
>is memory-bound.
>
>>And are you _sure_ you are optimizing things correctly?  I have seen _many_
>>cases where people have compiled and forgot to enable optimizing thinking it
>>was the default.  I did this once when I first compiled Crafty on a Solaris
>>box.  Default = zero optimization.  And when I found this, I ran about 5x
>>faster immediately.  :)
>
>Certainly am. The profile was run on an optimized MSVC binary using AMD
>Codeanalyst.
>Case in point:
>
>Crafty v18.10
>
>White(1): perft 6
>total moves=119060324  time=51.29
>
>Sjeng: perft 6
>Raw nodes for depth 6: 119060324
>Time : 43.34
>
>--
>GCP


The critical question then is are you copying any large structs around?  Are
you doing a make/unmake or a copy/make approach (copy/make drains the PC
memory bandwidth to zero).



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.