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

Scott Newell newell at cei.net
Mon Aug 5 13:09:37 CDT 2002


At 02:00 PM 8/5/2002 -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.

Scary.  This is very counter-intuitive (at least to me, personally).  I
would have guessed odd or prime array sizes would lead to weird alignments
and arrays that didn't fit evenly in a cache line (or multiple lines).
Shows what little I thought I knew about caches was wrong anyway!

>interesting treatment of this topic, I refer you to "High Performance
>Computing" by Dowd & Severance.

'ight.  ILL coming up...


newell



More information about the rescue mailing list