Sorting an array
Jarrett Billingsley
kb3ctd2 at yahoo.com
Mon Feb 5 17:21:23 PST 2007
"Bill Baxter" <dnewsgroup at billbaxter.com> wrote in message
news:eq8iau$2s4p$1 at digitaldaemon.com...
>
> I thought it used a quicksort with insertion sort for the smallest arrays.
> In fact such a beast seems to be in dmd/src/phobos/internal/qsort.d.
> Are you sure arrays use the qsort2.d implementation?
There's apparently some licensing issues with qsort.d? I'm not entirely
sure, but.. well to be honest I'm not sure whether it uses qsort.d or
qsort2.d. I shouldn't have jumped to that conclusion. Looking at the
phobos makefile it seems to use qsort.d, but qsort2.d is also mentioned.
Either way, it's probably not the fastest, as I wrote a templated
_recursive_ quicksort (not even using a stack like the one in qsort.d) that
consistently outperforms the builtin one by 5~10% (on my computer at least).
More information about the Digitalmars-d
mailing list