[Numpy-discussion] Performance of the array protocol
oliphant at ee.byu.edu
Tue Nov 1 08:19:01 EST 2005
Francesc Altet wrote:
>I'm trying to start using the array protocol for conversion between
>Numeric <--> numarray (and newcore in the future), but I'm a bit
>disappointed because of its performance. For numarray --> Numeric we
The other factor in this discussion is that you are creating and sharing
relatively small arrays.
The fromstring apporach is not a problem if all you need is a copy of
the data for small arrays.
The array protocol approach uses attribute lookups on an object. This
is going to have overhead that will only be useful for large arrays (or
arrays that you want to have share the same data region).
So, I guess the answer to your question is that for small arrays it is
an intrinsic limitation of the use of Python attributes in the array
More information about the NumPy-Discussion