No subject

Fred Tydeman uunet!ibminet.awdpa.ibm.com!ibmpa!tydeman
Fri Oct 11 06:59:03 PDT 1991


Subject:  Variable Length Arrays
 
In reviewing some recent threads (Powers of Two) in comp.unix.aix on
performance problems due to interaction between array sizes and cache
memory, statements were made that it is bad to have arrays be exact
powers of two in size.  So for example, an array A(512,512) is bad
because it is exactly a power of two in size, so causes excessive cache
misses.  It is better to have the array be declared as A(513,512) or
A(512,513) [depends upon if it is row major or column major order] but
used as A(512,512).  This implies that good procedures have both the
size of array declared and the size of the array used passed via the
argument list.
 
With respect to NCEG and Variable Length Arrays, it seems that the
approach in paper 91-029 would handle this case better than the 'fat'
pointer approach of paper 90-041.  The method of 91-029 is similar to
what FORTRAN programmers now do, (pass:  Pointer to array, size
declared, and size used), whereas, 91-041 would be a mixture of hidden
descriptor and explicit size used information (pass:  Pointer to array
and size used; get the size declared from the hidden descriptor in the
fat pointer).



More information about the Numeric-interest mailing list