Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about when to do { profile; watch; think; try; } while(1);

Author: Johan de Koning

Date: 18:09:37 09/09/03

Go up one level in this thread


On September 08, 2003 at 06:27:22, Uri Blass wrote:

>On September 08, 2003 at 03:55:59, Johan de Koning wrote:
>
>>On September 05, 2003 at 16:17:48, Uri Blass wrote:
>>
>>>I want to have some rule when it is a good idea to use local varaibles.
>>
>>Dear Uri,
>>Do you have any [BLEEP]ing clue about where 90% of your CPU is spent?

[selected quotes]

>12669.525   9.9    41129.386  32.1  7241728 @makemove@4 (boardi.obj)
> 9730.827   7.6     9730.827   7.6 23217388 @sort@4 (evaluate.obj)
> 7013.472   5.5    25544.791  19.9  7241728 @undomove@0 (boardi.obj)
> 5144.494   4.0   124395.265  97.1  3186150 @alphabeta@16 (evaluate.obj)
> 2018.445   1.6    29093.974  22.7  5934425 @gen@0 (boardi.obj)

My question was actually a rethorical one. My point being that rules of thumb
won't get you anywhere, it's the *actual* run time that matters.

In your case make/undo, gen, sort, and their children dominate performance.
So design them well and check if the code effectively uses registers.

In the 1980s you could stop right here, but today you'll have to go a step
further and create CPU friendly code. That's not easy at all, since you can't
measure runtime properly. A 1% change in speed is very likely just noise.
Running one function in a benchmark loop is also guaranteed to produce false
results (try TTprobing 1 position 1M times, and then the normal 1M x 1 :-).
Finally, entry/exit profiling adds a fair amount of cycles to all functions,
distorting the real runtime of small ones.

So life is tough: you'll have to watch, think, try, forever.

... Johan



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.