[Numpy-discussion] NumPy EIG much slower than MATLAB EIG

Chris Barker chris.barker at noaa.gov
Mon Apr 2 11:45:23 EDT 2012


On Mon, Apr 2, 2012 at 2:25 AM, Nathaniel Smith <njs at pobox.com> wrote:
> To see if this is an effect of numpy using C-order by default instead of
> Fortran-order, try measuring eig(x.T) instead of eig(x)?

Just to be clear, .T re-arranges the strides (Making it Fortran
order), butyou'll have to make sure your ariginal data is the
transpose of whatyou want.

I posted this on slashdot, but for completeness:

the code posted on slashdot is also profiling the random number
generation -- I have no idea how numpy and MATLAB's random number
generation compare, nor how random number generation compares to
eig(), but you should profile them independently to make sure.

-Chris





> -n
>
> On Apr 1, 2012 2:28 PM, "Kamesh Krishnamurthy" <kameshkk at gmail.com> wrote:
>>
>> Hello all,
>>
>> I profiled NumPy EIG and MATLAB EIG on the same Macbook pro, and both were
>> linking to the Accelerate framework BLAS. NumPy turns out to be ~4x slower.
>> I've posted details on Stackoverflow:
>> http://stackoverflow.com/q/9955021/974568
>>
>> Can someone please let me know the reason for the performance gap?
>>
>> Thanks,
>> Kamesh
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at scipy.org
>> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the NumPy-Discussion mailing list