Computer Chess Club Archives


Search

Terms

Messages

Subject: Question about data structures

Author: William Bryant

Date: 13:00:17 11/29/98


My question is for anyone with a good background in computer science.
When creating several data structures that may only hold up to 8 bits of
information, is there a access penalty for creating an array of char vs short vs
long? Although using long data type waste 3 bytes per item, the small amount of
memory lost is relatiavely insignificant.  Is there an access penalty for
reading and writing into the array since each byte element will not be aligned
on a word
boundary?

I will be programming on PPC chips especially targeting PPC 750 (G3).  I'm sure
different the answer is different for different processors.

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



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.