

Sort numbers faster than glibc qsort() - ais
http://bitbucket.org/ais/usort/wiki/Home
In which a number of sorting strategies are combined to minimize sort time of C numerical types.
======
ggchappell
Well, this is nice. However, I'm a bit surprised that you did a straight
Quicksort.

What I mean is that Quicksort has O(n^2) worst-case time complexity. But the
Introsort variant (Musser 1997) has O(n log n) worst case, is no slower than
Quicksort in the average case, and requires no significant additional space.

Introsort is a modification of Quicksort: it keeps track of the recursion
depth (counting tail calls as recursive calls). And if the depth exceeds 2
log_2 n, then it switches to Heap Sort for the current sublist.

~~~
ais
Thanks for the introsort suggestion... I'll be sure to investigate. There is a
general purpose quicksort implementation included in the package... but the
numerical sorting routines are primarily radix sort based and will not fall
victim to the recursion problem.

