Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Question about data structures

Author: David Blackman

Date: 23:07:26 11/29/98

Go up one level in this thread


On November 29, 1998 at 16:00:17, William Bryant wrote:


>I realize when moving data from memory and to memory, the more efficient the
>data is represented the more cana be transfered in a single fetch and store
>cycles, but how does this impact data arrays.
>	char Board[64] vs short Board[64] vs long Board[64]
>
>Thanks in Advance
>
>William

If it fits in 8 bits, use an 8 bit data type. You might want to hide
it in a typedef in case you have to change the type later on.
Reducing memory bandwidth and fitting more useful information in cache
is a big win on modern CPUs.

Of course you shouldn't worry too much about low level performance stuff like
this at first. Using proper high level algorithms is more important. In fact
just keeping it simple and getting a working program might be more important.
You'll probably learn a lot more getting a simple program working, than
writing 30% of a complicated one.



This page took 0.01 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.