This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Limit std::sort comparisons on small list


Hi,

On 10/03/2013 10:04 PM, FranÃois Dumont wrote:
So no impact on sort because the number of elements involved is too important. Good, even if limited, impact on stable_sort because it reduces the number of comparison by about 0.5% in the random case. I have added a test to check that on small number of elements it has the expected impact, only 1 comparison when 2 elements in the array.
Thanks for your help on this. While we wait for comments from Chris, Marc and other interested people, I have a rather simple-minded question for you: how would you explain that the number of comparisons for the sort performance tests remains *exactly* the same, while we know that the change helps for 2 elements, avoiding a comparison? Isn't navely weird that a similar situation *never* happens for the performance tests? Surely it does happen if we change the random seed of the random variant, at least an handful of times?!?

Thanks again,
Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]