[libcxx] pdqsort - a faster std::sort

Marshall Clow mclow.lists at gmail.com
Sun Apr 5 16:21:04 PDT 2015


On Sun, Apr 5, 2015 at 12:29 AM, Orson Peters <orsonpeters at gmail.com> wrote:

> I’ve added “[libcxx]” to the subject of this email.  It was accidentally
> omitted from my original post, and this may have caused this post to be
> accidentally overlooked by the libc++ development team.
>
> A while back I shortly discussed this with M. Clow, today I post it here
> to poll public interest.
>
> I'd like to present pattern-defeating quicksort, a novel sorting
> algorithm. It is as fast or faster than std::sort on any implementation
> I've tested (libstdc++, libc++, VS2013) for both random data and a variety
> of patterns (equal, asc/desc, pipe organ, etc).
>
> A short explanation of the design of pdqsort can be found in the readme:
> https://github.com/orlp/pdqsort .
>
> The performance chart included in the readme is benchmarked against
> libstdc++, a comparison with libc++ (compiled with clang) can be found
> here: http://i.imgur.com/JRiJk0g.png .
>
> The code of pdqsort is very short (~300LOC) and clean. Understanding
> pdqsort and integration should be painless.
>
> I'm willing to prepare a patch and do the legal wizardry required to
> integrate pdqsort as std::sort in libstdc++, if the interest is there.
> This would also solve this bug I found:
> https://llvm.org/bugs/show_bug.cgi?id=20837
>
> If you have any questions after reading the readme, please do reply and I
> will do my best to answer them.
>
>
Orson --

FWIW, the reason I haven't moved on this is that we (ok, Eric) is working
on a set of benchmarking tests for a bunch of libc++ (including std::sort).

It's not that I'm not interested.

-- Marshall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150405/c7c25fd0/attachment.html>


More information about the cfe-commits mailing list