[Numpy-discussion] sorting and nans, timings.

Charles R Harris charlesr.harris@gmail....
Wed Jul 22 23:36:25 CDT 2009

Hi All,

I changed the sort routines to sort nans to the end and got some timings.
Sorting 100000 random doubles 100 times yields:

               current   nan version
quicksort     1.17 sec    1.29 sec
mergesort     1.37 sec    1.36 sec
heapsort      1.83 sec    2.12 sec

Curiously, mergesort doesn't seem to suffer at all. This is using x != x for
nan detection, using npy_isnan is notably slower with my compiler (gcc
4.3.0).  So, what do folks want to do about sorting nans?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090722/e2d6bfdc/attachment.html 

More information about the NumPy-Discussion mailing list