Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: data structure size on Pentium 1/2/3

Author: Robert Hyatt

Date: 15:53:23 04/18/00

Go up one level in this thread


On April 18, 2000 at 12:45:36, John Coffey wrote:

>I am writting a data structure that I have to copy with every new node.  I was
>planning on using 16 bytes, but could maybe get it down to 8  using short
>integers.  I am wondering if short integers (16 bits) can be accessed any faster
>than 32 bit integers or if they are actually slower.  Also will the difference
>between copying 8 bytes and 16 bytes per node make any difference in
>terms of my overall speed?

It will help in several ways.  If your structure is 8 bytes, you will get 4
of them loaded into one line of cache, rather than requiring 2 lines.  This
conserves cache.  It reduces memory bandwidth, but only if you talk about
chunks of 32 bytes. IE try using a board of 64 ints, then 64 chars. The
64 chars burns the 64 ints up badly...



>
>My target platform is a Pentium-III 450.
>
>john Coffey


The main thing is to think "temporal locality".  Put things that are used
close together in time, close together in memory.  The referencing the first
will load the others as part of the same 32 byte cache line...



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.