[Numpy-discussion] Maximum available dimensions in numpy
oliphant.travis at ieee.org
Tue Jan 17 15:37:07 CST 2006
Tim Hochberg wrote:
> I don't see anything wrong with making the maximum dimension size a
> compile time option though. However, since in the common case the
> extra dimensions are unlikely to affect performance in any meaningful,
> I'd recomend that the maximum number of default dimensions stay large
> by default. Thus people who need to conserve bytes, which I'd
> consider the rare case, have the option of reducing the max dimensions
> while the arrays behave in an unsuprising manner when compiled in the
> normal manner.
> If someone has the extra time, it would be interesting to see some
> data about how always mallocing the extra dimensions, so there was no
> maximum dimensions limit, affects performance. I'd also be interested
> in seeing cases where the extra dimensions actually affect performance
> before doing to stuff complicate^H^H^H^H^H^H^H^H fix things.
Right now, the array has dimensions and strides arrays malloced as
necessary. So, as far as the array-object itself is concerned there is
no upper limit.
The dimension limit only comes from the fact that for ease in coding,
static arrays for dimensions and/or strides are used in quite a few
places in the code. If these were all converted to use dynamic memory
from the heap, then the dimension limit would go away.
If anybody wants to try and do this, they are certainly welcome...
More information about the Numpy-discussion