[SciPy-dev] Indexing array performance

Travis Oliphant oliphant.travis at ieee.org
Sat Dec 31 13:10:44 CST 2005

Francesc Altet wrote:

>In [114]: t3 = timeit.Timer('a=empty(shape=10000);a[arange(10000)]','from 
>scipy.base import empty, arange')
>In [115]: t3.repeat(3,1000)
>Out[115]: [3.5126161575317383, 3.5309510231018066, 3.5558919906616211]
>In [116]: t4 = timeit.Timer('a=array(None,shape=10000);a[arange(10000)]','from 
>numarray import array, arange')
>In [117]: t4.repeat(3,1000)
>Out[117]: [2.0824751853942871, 2.1258058547973633, 2.0946059226989746]
>It seems like if the index array feature can be further optimized in
Thank you very much for your timings.  It is important to get things as 
fast as we can, especially with all the good code in numarray to borrow 
from.  I am really committed to making scipy_core as fast as it can be.

I believe you are right about the indexing.   I will look more closely 
at this.  The indexing code is still "first-cut" and has not received 
any optimization attention.    It would be good to look at 2- and 3-D 
timings, however, to see if the speed up here is a 1-d optimization that 
scipy_core is not doing.

Best regards,


More information about the Scipy-dev mailing list