Computer Chess Club Archives


Search

Terms

Messages

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

Author: Dan Newman

Date: 13:16:24 04/18/00

Go up one level in this thread


On April 18, 2000 at 14:27:52, Andrew Dados wrote:

>On April 18, 2000 at 12:48:28, Tom Kerrigan wrote:
>
>>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
>>
>>They're actually slower.
>>
>
>I'll be picky: that depends on alignment - may be faster or slower or same...:)
>Technically mov ax,[data16] has same timing as mov eax,[data32].
>
>>>between copying 8 bytes and 16 bytes per node make any difference in
>>>terms of my overall speed?
>>
>>I doubt it. That's just 2 extra instructions, moving data around in cache.
>>
>>-Tom

I've found that doing 16-bit stuff tends to be a lot slower than both 32-bit
and 8-bit and 8-bit stuff to be only a little slower than 32-bit.  (This on
P6's, Celerons, and PIII's.)

Sometimes 8-bit stuff can be faster than 32-bit.  If you have a large array
of integral type that's frequently accessed, and all you need is 8-bits per
entry, you might get a speed improvement going to byte sized entries: the
processor can grab a larger number of enrtries in a cache line which may more
than offset the higher cost of 8-bit ops.

-Dan.



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.