[Bizgres-general] Slow glibc qsort, two versions that are much
faster
Simon Riggs
simon at 2ndquadrant.com
Fri Dec 9 09:30:25 GMT 2005
On Fri, 2005-12-09 at 00:43 -0800, Luke Lonergan wrote:
> Simon,
>
> On 12/9/05 12:36 AM, "Simon Riggs" <simon at 2ndquadrant.com> wrote:
>
> >> In my tests (attached, and results below), the qsortG routine outperforms
> >> the Linux/qlibc qsort routine by as much as 94% (10 times). It's different
> >> on Mac OSX and Solaris where the zero set seems to have a fast
> >> implementation.
> >
> > Sounds good and licence is compatible.
>
> Yep! Pleasant mathematician made it so.
>
> > Can you explain the zero set thing a bit more? Not quite sure what that
> > is. Empty set? All same key?
>
> The "zero set" I refer to is just an array of all zero (all same key). That
> was brought forward as a catastrophic edge case for the Solaris qsort
> implementation a few years ago.
>
> I threw in a random set, and the reversed ordered set for comparison
> purposes. I'm not sure how to characterize all sort sets of interest.
>
Looks good then.
Best Regards, Simon Riggs
More information about the Bizgres-general
mailing list