[Numpy-discussion] numpy 10x slower than native Python arrays for simple operations?
Sat Feb 6 15:21:55 CST 2010
I have done some profiling, and the results are completely
counterintuitive. For simple array access operations, numpy and
array.array are 10x slower than native Python arrays.
I am using numpy 1.3.0, the standard Ubuntu 9.03 package.
Why am I getting such slow access speeds?
Note that for "array access", I am doing operations of the form:
a[i] += 1
 * 20000000
Access: 2.3M / sec
array.array('L',  * 20000000)
array.array('L', (0 for i in range(20000000)))
Access: 175K/sec, presumably, based upon the profile for the other
Any idea why my numpy array access is so slow?
More information about the NumPy-Discussion