Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Move structure

Author: Robert Hyatt

Date: 10:23:33 02/26/04

Go up one level in this thread


On February 26, 2004 at 07:08:36, martin fierz wrote:

>On February 25, 2004 at 11:02:29, Robert Hyatt wrote:
>
>>On February 25, 2004 at 08:17:03, Omid David Tabibi wrote:
>>
>>>On February 24, 2004 at 20:38:06, Robert Hyatt wrote:
>>>
>>>>On February 24, 2004 at 17:17:09, Omid David Tabibi wrote:
>>>>
>>>>>On February 23, 2004 at 16:11:38, Russell Reagan wrote:
>>>>>
>>>>>>On February 23, 2004 at 10:51:54, Omid David Tabibi wrote:
>>>>>>
>>>>>>>The question is, was it worth the time to do the change? Wouldn't it be better
>>>>>>>to spend the time parallelizing Tiger (i.e., Deep Tiger)?
>>>>>>>
>>>>>>>I have 32 bits for move, and changing it to 16 bits is in my todo queue for a
>>>>>>>long time (more than a year). But there are always more important things to do.
>>>>>>
>>>>>>Surely you didn't put 'unsigned long' all over your program did you? :) Using a
>>>>>>typedef makes this a one line change:
>>>>>>
>>>>>>typedef unsigned long MoveType;
>>>>>>
>>>>>>to...
>>>>>>
>>>>>>typedef unsigned short MoveType;
>>>>>
>>>>>It is not just changing the 'int' to 'short'. It is a whole mess of changing all
>>>>>the routines that access those 32 bit moves and change them all so that now they
>>>>>would correctly access the 16 bit moves.
>>>>>
>>>>>But even after doing that, the benefit will be negligible.
>>>>
>>>>Think encapsulation.
>>>>
>>>>In C, that can be done by using macros to access things that might change, so
>>>>that you change the macro, and recompile everything and away you go...
>>>
>>>I know, but too late to introduce those macros now, especially when no
>>>significant performance boost will be achieved :)
>>>
>>>I have many macros, but the last thing I thought about was to add macros for
>>>accessing the move structure...
>>
>>Macros like From(), To(), Piece(), Type(), Promote(), Captured() are easy to
>>add, even without using them.  Then as you run across places where you use the
>>rank or file or from or to or whatever, you can replace them slowly over time.
>>I have a large number of macros to attempt to make the program more readable, as
>>well as easier to work on...
>>
>>Not every decision is based on performance only...
>
>you can see this as performance enhancement too. perhaps not in raw search
>speed, but in terms of easier readability leading to less bugs and more
>productivity because you can change things faster.
>
>i certainly think that way about these things.
>
>cheers
>  martin
>

A different kind of "performance" from how the word is usually used, but I
agree.  That is why I did most of my macros, as the code can get fairly ugly for
some things.



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.