[Numpy-discussion] speed of numpy vs matlab on dot product
Rob Hooft
rob at hooft.net
Sun Jun 11 04:31:26 EDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
JJ wrote:
> python
> import numpy
> import scipy
> a = scipy.random.normal(0,1,[10000,2000])
> b = scipy.random.normal(0,1,[10000,2000])
> c = scipy.dot(a,scipy.transpose(b))
Hi,
My experience with the old Numeric tells me that the first thing I would
try to speed this up is to copy the transposed b into a fresh array. It
might be that the memory access in dot is very inefficient due to the
transposed (and hence large-stride) array.
Of course I may be completely wrong.
Rob
- --
Rob W.W. Hooft || rob at hooft.net || http://www.hooft.net/people/rob/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEi9TdH7J/Cv8rb3QRAgXYAJ9EcJtfUeX3H0ZWf22AapOvC3dgTwCgtF5r
QW6si4kqTjCvifCfTc/ShC0=
=uuUY
-----END PGP SIGNATURE-----
More information about the NumPy-Discussion
mailing list