<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Apr 5, 2015 at 12:29 AM, Orson Peters <span dir="ltr"><<a href="mailto:orsonpeters@gmail.com" target="_blank">orsonpeters@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8000001907349px">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.</span><br><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">A while back I shortly discussed this with M. Clow, today I post it here to poll public interest.</span><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">I'd like to present pattern-defeating quicksort, a novel sorting algorithm. It is as fast or faster than std::<span>sort</span> on any implementation I've tested (libstdc++, libc++, VS2013) for both random data and a variety of patterns (equal, asc/desc, pipe organ, etc).</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">A short explanation of the design of pdqsort can be found in the readme: <a href="https://github.com/orlp/pdqsort" target="_blank">https://github.com/orlp/pdqsort</a> .</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">The performance chart included in the readme is benchmarked against libstdc++, a comparison with libc++ (compiled with clang) can be found here: <a href="http://i.imgur.com/JRiJk0g.png" target="_blank">http://i.imgur.com/JRiJk0g.png</a> .</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">The code of pdqsort is very short (~300LOC) and clean. Understanding pdqsort and integration should be painless.</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">I'm willing to prepare a patch and do the legal wizardry required to integrate pdqsort as std::<span>sort</span> in libstdc++, if the interest is there. This would also solve this bug I found: <a href="https://llvm.org/bugs/show_bug.cgi?id=20837" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=20837</a></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">If you have any questions after reading the readme, please do reply and I will do my best to answer them.</div></div><div style="font-size:12.8000001907349px"><br></div></div></blockquote><div><br></div><div>Orson --</div><div><br></div><div>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). </div></div><br></div><div class="gmail_extra">It's not that I'm not interested.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- Marshall</div><div class="gmail_extra"><br></div></div>