Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Question about data structures

Author: Tom Kerrigan

Date: 11:30:59 12/02/98

Go up one level in this thread


You're right, if other people are running faster with chars, then the statement
I made was wrong.

I tested this with my own program, and moving from chars to ints for a few
critical arrays sped up the program by more than 5%. Maybe I'm the exception to
the rule.

-Tom


On December 01, 1998 at 18:02:47, Bruce Moreland wrote:

>
>On November 30, 1998 at 12:01:05, Tom Kerrigan wrote:
>
>>This is all fine and good for larger arrays that you don't access a lot, but if
>>you're talking about your representation of the board,
>>
>>int chess_board[64];
>>
>>will be a serious win over
>>
>>char chess_board[64];
>
>I don't know why you are saying this in the face of at least two people saying
>that they tried this exact thing and it was slow.
>
>On an Intel machine you have to do an extra instruction to read a char into EAX,
>unless you use movzx or movsx, which suck.
>
>On an Alpha you have to deal with the alpha (21164) not even having an
>instruction that will read a byte.
>
>These are reasons why I intuit that it might go slower, but if I used this data
>structure I would surely test it and know for sure.
>
>I think that discussions of which implementation will go faster, that are based
>upon predicted instruction timing or cache behavior, are almost always useless.
>
>bruce



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.