Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about optimizing code

Author: Uri Blass

Date: 06:00:53 07/07/03

Go up one level in this thread


On July 07, 2003 at 05:30:38, Reinhard Scharnagl wrote:

>Hi Uri,
>
>a good solution depends on whether:
>
>a) each bit of the eight has the same probability to be set or
>   they are decreasing or they are increasing,
>b) the average number of the bits set,
>
>so please explain on that.
>
>Reinhard

I calculate exact ditribution of the bits in the first 10,000,000 nodes from the
opening position and here is the result:

I have 20,357,657 cases of calling the switch command.
The average number of bits set is 1.27405

in 2895517 cases  bit 0 is set
in 2910299 cases  bit 1 is set
in 2123957 cases  bit 2 is set
in 2733137 cases  bit 3 is set
in 5285584 cases  bit 4 is set
in 4632172 cases  bit 5 is set
in 4706124 cases  bit 6 is set
in 5121911 cases  bit 7 is set

When I think about it
I am not surprised from the fact that bits 4,5,6,7 are set more often because
they are about bishop direction and pawns only control bishop directions(it may
suggest that I may start with them in the switch)

I guess that I am going to go with Tim's suggestion and only start from the
opposite direction because I do not think that trying to do more optimization is
very important considering the fact that I call this switch only 2 times per
node and movei is not a fast searcher.

Uri



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.