[SciPy-dev] Sorting speed

Francesc Altet faltet at carabos.com
Fri Dec 30 12:18:25 CST 2005


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.

As PyTables uses extensively this kind of sorting for indexing, it
would be nice to see scipy_core with at least the speed of numarray in
this sense. Nevertheless, as this only affects to the array package in
the core, and there are no plans to migrate to scipy_core anytime
soon, this is not a high priority for me. Just wanted to point it out.


>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data

More information about the Scipy-dev mailing list