Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Performance improvement suggestion for Crafty and some similar progr

Author: Steven Edwards

Date: 14:14:02 09/10/03

Go up one level in this thread


On September 10, 2003 at 13:20:50, Robert Hyatt wrote:
>On September 10, 2003 at 12:38:17, Steven Edwards wrote:

>You should look at the code more carefully...
>
>Crafty dynamically computes "nodes_between_time_checks" so that it is a
>bigger number on faster machines, smaller on slower machines.  I set it so
>that I check every "reasonable" unit of time.  For normal time controls, say
>40 moves in 2 hours, I check no more than once per second.  For bullet (game
>in 1 minute) I check much more frequently.

Yes, I did see all the places in Crafty where nodes_between_time_checks gets
different values plus the various references to nodes_per_second (and to
average_nps), so I agree that it works.  But I say that the timer thread method
gives a more uniform result with less code.

>That works ok.  The overhead for scheduling a thread every N units of time is
>a bit of a pain.

Since the timer thread has to be launched only once per search (or only once per
program invocation depending on how it's set up), the pain here must be the time
used by recurring system calls and context switches caused by the usleep()
reference.  I am sure you are correct that there is some overhead involved here,
but in my tests with usleep() intervals down to 10 ms I have been unable to see
any measurable slowdowns.



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.