[rescue] Re: Re: OH YEA??? [was: Re: Ultra?]

Joshua D Boyd jdboyd at cs.millersville.edu
Mon Aug 5 13:08:50 CDT 2002


On Mon, Aug 05, 2002 at 02:00:47PM -0400, Dave McGuire wrote:
>   Just as a side note, in my experience the worst cache-friendliness
> offenders have been arrays whose sizes are even numbers, or even
> worse, powers of two.  This is a very common programming practice that
> blows most caches out of the water.  Many programmers "think" in terms
> of powers of two, so instead of a 100-element array they'd make it 128
> elements, when it should probably be something like 97 or 101.
> Another big one is highly randomized array access.

Could you give a brief overview on why even numbers of elements are
bad here?  If all I need is 100 elements, why would 101 be better?

-- 
Joshua D. Boyd



More information about the rescue mailing list