[libstdc++] pdqsort - a faster std::sort

François Dumont frs.dumont@gmail.com
Sat Apr 11 08:00:00 GMT 2015


Hello

     I think comparator is taken by copy simply because the Standard 
signature is taking it by copy. We expect gcc to do a good job to 
optimize away the intermediate copy. You should rely run bench to check 
if it has any impact on the perf.

     Note that I also plan to implement PR 60519 thanks to those wrapper 
as all algos are relying on it. It is a very nice central place to 
implement additional checks.

François


On 09/04/2015 00:51, Marc Glisse wrote:
> On Thu, 9 Apr 2015, Orson Peters wrote:
>
>> 1. Should iter_swap be used like swap (using std::swap; followed by
>>    unqualified lookup), or should it be fully qualified as
>>    std::iter_swap?
>
> Fully qualified.
>
>> 2. Is there any particular reason _Iter_comp_iter and co store copies
>>    of the comparator, and not a reference?
>
> Probably not. But if that changes, it should be a separate patch, 
> submitted in a separate email.
>
> Note that you can search the mailing list for explanations on the 
> strange functor stuff if you are curious, it is quite recent. Here are 
> some random links, but the conversation was spread over many more 
> months, the interesting parts may be in other threads (look for the 
> name "François Dumont").
>
> https://gcc.gnu.org/ml/libstdc++/2012-05/msg00006.html
> https://gcc.gnu.org/ml/libstdc++/2013-09/msg00004.html
> https://gcc.gnu.org/ml/libstdc++/2013-09/msg00150.html
>



More information about the Libstdc++ mailing list