[Numpy-discussion] speed degression

Travis Oliphant oliphant.travis at ieee.org
Wed Aug 23 14:59:29 CDT 2006


Charles R Harris wrote:
> Yes,
>
> On 8/19/06, Joris De Ridder <joris at ster.kuleuven.be 
> <mailto:joris at ster.kuleuven.be>> wrote:
> > Hi,
> >
> > Some of my code is heavily using large complex arrays, and I noticed 
> a speed
> > degression in NumPy 1.0b2 with respect to Numarray. The following 
> code snippet
> > is an example that on my computer runs 10% faster in Numarray than 
> in NumPy.
> >
> > >>> A = zeros(1000000, complex)
> > >>> for k in range(1000):
> > ...        A *= zeros(1000000, complex)
> >
> > (I replaced 'complex' with 'Complex' in Numarray).  Can anyone 
> confirm this?
>
The multiply (and divide functions) for complex arrays were using the 
"generic interface" (probably because this is what Numeric did) which 
calls out to a function to compute each result.    I just committed a 
switch to "in-line" the multiplication and division calls.

The speed-up is about that 10%.  Now, my numarray and NumPy versions of 
the test are very similar.


-Travis





More information about the Numpy-discussion mailing list