[Numpy-discussion] performance matrix multiplication vs. matlab

Sebastian Walter sebastian.walter at gmail.com
Thu Jun 4 10:02:03 EDT 2009


Have a look at this thread:
http://www.mail-archive.com/numpy-discussion@scipy.org/msg13085.html

The speed difference is probably due to the fact that the matrix
multiplication does not call optimized an optimized blas routine, e.g.
the ATLAS blas.

Sebastian


On Thu, Jun 4, 2009 at 3:36 PM, David Paul Reichert
<D.P.Reichert at sms.ed.ac.uk> wrote:
> Hi all,
>
> I would be glad if someone could help me with
> the following issue:
>
>  From what I've read on the web it appears to me
> that numpy should be about as fast as matlab. However,
> when I do simple matrix multiplication, it consistently
> appears to be about 5 times slower. I tested this using
>
> A = 0.9 * numpy.matlib.ones((500,100))
> B = 0.8 * numpy.matlib.ones((500,100))
>
> def test():
>     for i in range(1000):
>         A*B.T
>
> I also used ten times larger matrices with ten times less
> iterations, used xrange instead of range, arrays instead
> of matrices, and tested it on two different machines,
> and the result always seems to be the same.
>
> Any idea what could go wrong? I'm using ipython and
> matlab R2008b.
>
> Thanks,
>
> David
>
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



More information about the NumPy-Discussion mailing list