Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Is it good to give a function a struct of 4 chars or maybe it is

Author: Tom Kerrigan

Date: 12:10:47 04/17/03

Go up one level in this thread


On April 16, 2003 at 07:07:30, Uri Blass wrote:

>On April 16, 2003 at 05:58:54, Tom Kerrigan wrote:
>
>>These data structures look very familiar. ;)
>
>Yes
>
>The structure is taken from your program tscp.
>
>I started movei by copying part of the data structures of tscp
>but not all of it(for example I never used mailbox) and I have a lot of
>data structures that are not used by tscp.
>
>I may send you part of the code of movei if you are interested
>but I do not plan to make it public.

No, that's fine, I'm not mad or anything, just making a comment.

>People told me that in order to do the code faster it is better to get rid
>of structure of 4 chars and use one integer but I decided at this point not to
>do it and there are a lot of options to improve it even without doing it.

I don't think that's necessarily true. If you're using a reasonable compiler, it
will move a 4 byte struct around as a 32 bit word, and it will access the bytes
as fast as possible given your particular processor. (Which may even be faster
than the shift-and-mask system that others are suggesting.)

-Tom



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.