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

2012-04-08 Thread Paul Anton Letnes
On 2. apr. 2012, at 15:47, David Cournapeau wrote: > > > On Sun, Apr 1, 2012 at 2:28 PM, Kamesh Krishnamurthy > 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.

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

2012-04-02 Thread Nathaniel Smith
On Mon, Apr 2, 2012 at 6:18 PM, Aronne Merrelli wrote: > On Sun, Apr 1, 2012 at 8:28 AM, Kamesh Krishnamurthy > 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. >>

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

2012-04-02 Thread Aronne Merrelli
On Sun, Apr 1, 2012 at 8:28 AM, Kamesh Krishnamurthy 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

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

2012-04-02 Thread Olivier Grisel
Le 2 avril 2012 18:36, Frédéric Bastien a écrit : > numpy.random are not optimized. If matlab use the random number from > mkl, they will be much faster. In that case this is indeed negligible: In [1]: %timeit np.random.randn(2000, 2000) 1 loops, best of 3: 306 ms per loop -- Olivier http://tw

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

2012-04-02 Thread Frédéric Bastien
numpy.random are not optimized. If matlab use the random number from mkl, they will be much faster. Fred On Mon, Apr 2, 2012 at 12:04 PM, David Cournapeau wrote: > > > On Mon, Apr 2, 2012 at 4:45 PM, Chris Barker wrote: >> >> On Mon, Apr 2, 2012 at 2:25 AM, Nathaniel Smith wrote: >> > To see i

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

2012-04-02 Thread David Cournapeau
On Mon, Apr 2, 2012 at 4:45 PM, Chris Barker wrote: > On Mon, Apr 2, 2012 at 2:25 AM, Nathaniel Smith 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

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

2012-04-02 Thread Chris Barker
On Mon, Apr 2, 2012 at 2:25 AM, Nathaniel Smith 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 ari

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

2012-04-02 Thread David Cournapeau
On Sun, Apr 1, 2012 at 2:28 PM, Kamesh Krishnamurthy 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

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

2012-04-02 Thread Kamesh Krishnamurthy
Changing the array to Fortran order using numpy.ndarray.T does not help much in my machine. But, this may be important since the LAPACK routines are written in Fortran 90. On 2 April 2012 12:25, Nathaniel Smith wrote: > To see if this is an effect of numpy using C-order by default instead of > F

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

2012-04-02 Thread Nathaniel Smith
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)? -n On Apr 1, 2012 2:28 PM, "Kamesh Krishnamurthy" wrote: > Hello all, > > I profiled NumPy EIG and MATLAB EIG on the same Macbook pro, and both were > linking to the

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

2012-04-01 Thread Kamesh Krishnamurthy
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 perfo