[SciPy-dev] Sorting speed

Travis Oliphant oliphant.travis at ieee.org
Fri Dec 30 13:21:24 CST 2005

Francesc Altet wrote:

>It seems that scipy_core ( is far more slower than numarray
>(1.5.0) when sorting arrays:
>In [43]: t5=timeit.Timer('a=sc.empty(shape=10000);a.sort()', 'import 
>scipy.base as sc')
>In [44]: t5.repeat(3,100)
>Out[44]: [0.40603208541870117, 0.41605615615844727, 0.39800286293029785]
>In [45]: t4=timeit.Timer('a=na.array(None, shape=10000);a.sort()', 'import 
>numarray as na')
>In [46]: t4.repeat(3,100)
>Out[46]: [0.090479135513305664, 0.086208105087280273, 0.086167097091674805]
>i.e. numarray is roughly 5x faster than scipy_core.

There are many sorting algorithms in numarray.  I'm not sure which one 
is being used regularly, but I'd like to see them brought over, though, 
which shouldn't be too big of a deal and is on the radar.  

Another opportunity for someone to get their hands dirty....


More information about the Scipy-dev mailing list