Re: [boost] [sort] pdqsort
Hi, Orson here, I'm the original author of pdqsort. As discussed in this long github issue ( https://github.com/boostorg/sort/issues/11), I have full copyright on the pdqsort implementation (which is freely available under the zlib license on https://github.com/orlp/pdqsort), and am willing to provide it to Boost free of charge under the Boost license. @Marc Glisse, since your 2015 experiment the code has changed, and pdqsort now uses a technique called block quicksort. It's substantially faster for branchless comparisons (50-80%), but it seems that on some systems it also give significant (5-15%) slowdowns for branchful code. I will revert pdqsort's default implementation to the old version, except when the passed in type is built-in, and the comparison operator is std::less / std::greater, then I will use the branchless code. I will provide the branchless code explicitly as well, under a different function name, for experienced users that know their comparison function is branchless. The old implementation was never slower than std::sort in my experiments, for the record. If any of you have further questions, please do let me know.
On 26/01/2017 23:33, Orson Peters wrote:
Hi, Orson here, I'm the original author of pdqsort.
Hi Orson,
As discussed in this long github issue ( https://github.com/boostorg/sort/issues/11), I have full copyright on the pdqsort implementation (which is freely available under the zlib license on https://github.com/orlp/pdqsort), and am willing to provide it to Boost free of charge under the Boost license.
Wonderful. I think it'll be very useful in Boost.
I will revert pdqsort's default implementation to the old version, except when the passed in type is built-in, and the comparison operator is std::less / std::greater, then I will use the branchless code. I will provide the branchless code explicitly as well, under a different function name, for experienced users that know their comparison function is branchless. The old implementation was never slower than std::sort in my experiments, for the record.
Sounds good. The branchless part is interesting, but speed up in patterns (which I guess includes partially sorted data) is the most important feature IMHO.
If any of you have further questions, please do let me know.
Thanks! Ion
participants (2)
-
Ion GaztaƱaga
-
Orson Peters