Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about speed in hash tables

Author: Uri Blass

Date: 07:54:15 10/17/02

Go up one level in this thread


On October 17, 2002 at 10:12:26, Robert Hyatt wrote:

>On October 17, 2002 at 06:20:11, Uri Blass wrote:
>
>>Today my repetition detection is not done based on hash tables and I plan to do
>>it faster by hash tables.
>>
>>After every makemove I calculate the new hash key for the hash tables
>>but I do not have an array of all the hash keys and I use a global varaible
>>__int64 zob to have the hash key.
>>
>>
>>
>>I plan to add an array zobkey[max_plies_of_game] for hash keys
>>My question is what is faster:
>>
>>1)Doing all the calculation on zob and after finishing them to do
>>zobkey[hply]=zob;
>>2)Doing all the calculations on zobkey[hply]
>
>I can't imagine it would matter at all, if zob is a local variable.

In movei zob is a global varaible because I use it both in makemove
and in the search for order of moves that is in another file of the project.

I did not have the array zobkey[hply] and had to use zob in both files.

I do not see a reason that I need to change it to a local varaible.

>>
>>I guess that I am going to choose 1 because it is more simple and I guess that
>>the difference in speed is less than 0.1% but I am interested to know what is
>>faster.
>>
>>Doing all the calculations on zobkey[hply] seems to have one less arithmetic
>>calculation but more array calls.
>
>Not to a compiler.  You load x[y] into a register and you only reference the
>register
>after that.
>

I do not use the word register in movei because
I assume that the compiler knows better than me to decide to put varaibles in
the registers.

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.