21 Sep
2015
21 Sep
'15
6:53 p.m.
Ion Gazta?aga wrote:
I'm trying to improve insertion times for flat associative containers. In range insertions one optimization is to insert the whole range in the end of the container and sort the whole vector instead of trying a loop.
Hi Ion, We've discussed this before... Why do you (still) want to sort the whole container, rather than just sorting the new items and then using inplace_merge? The idea of using the allocated-but-unused part of the buffer for temporary storage is an interesting one, which would benefit inplace_merge as well as stable_sort. Have you tried to quantify the benefits? Cheers, Phil.