[Numpy-discussion] Numpy performance vs Matlab.

Sturla Molden sturla@molden...
Wed Jan 7 12:50:54 CST 2009

On 1/7/2009 6:51 PM, Christopher Barker wrote:

> Even with this nifty JIT, 

It is not a very nifty JIT. It can transform some simple loops into 
vectorized expressions. And it removes the overhead from indexing with 

But if you are among those that do

n = length(x)
m = 0
for i = 1.0 : n
   m = m + x(i)
m = m / n

instead of

m = mean(x)

it will be nifty enough.

> All lot of folks seem to think that the only reason to "vectorize" code 
> in MATLAB, numpy, etc, is for better performance. If MATLAB now has a 
> good JIT, then there is no point -- I think that's a mistake. 

Fortran 90/95 has array slicing as well.

Sturla Molden

More information about the Numpy-discussion mailing list