Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: typical nps on single cpus

Author: Dan Newman

Date: 17:39:19 02/14/00

Go up one level in this thread


On February 14, 2000 at 03:16:33, Dave Gomboc wrote:

>On February 13, 2000 at 17:44:43, Dan Newman wrote:
>
>>On February 13, 2000 at 12:20:21, Will Singleton wrote:
>>
>>>On February 13, 2000 at 06:57:16, Dan Newman wrote:
>>>
>>>>On February 13, 2000 at 03:35:50, Will Singleton wrote:
>>>>
>>>>>I am always interested in the nps kibitzed by programs playing on ICC.  You can
>>>>>never be sure as to the accuracy, since one can fiddle with the numbers.  But I
>>>>>was surprised the other day to see an amateur program getting in excess of 1
>>>>>million nps on a 700mhz machine.  Many amateur progs get around 100knps or less.
>>>>>
>>>>>Just wondering.  Anybody get close to or more than 1000 nps per mhz?
>>>>>
>>>>>Will
>>>>
>>>>Shrike gets about that.  A month or so ago it was hitting 530 knps on a
>>>>PIII/500, but now it's down to 490 after adding a bunch of eval.  (These
>>>>figures are average over WAC.)  It maxes out at about 750 knps--when there's
>>>>only one pawn left :).  So I guess I'm at about 980 nps/MHz and going down...
>>>>
>>>>-Dan.
>>>
>>>What do you do to get that speed?  Bitboards, slim eval, anything else?
>>>
>>>Will
>>
>>Well, I tend to unroll loops, and avoid if-tests where possible.  I use
>>switch statements to select just the right piece of code in the move
>>generators and make/undo and thus avoid a lot of if-tests.  My code
>>is rather bloated as a result: about 11,000 LOC with the comments stripped
>>out.
>>
>>-Dan.
>
>How much faster do you think a switch is than using virtual dispatch?
>
>Dave

I don't know, but my gut feeling is that it would be faster.  I think
the function call overhead would be a bit larger than the typical switch
overhead.  OTOH, if you replace a switch statement in make() (assuming
you switch on move types) with an array of function pointers indexed by
move type, this will probably go faster.  (I did this in my checkers
program and it was a little faster.)

OTOH, a lot might be gained (from an ease of programming standpoint) by
going to the virtual dispatch.  I've used a lot of C++ish things in
Shrike, and that's helped a lot, but the only place I've used inheritance
and virtual functions is in the command interface...

-Dan.



This page took 0.01 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.