5 ms·
The author is pointing out two problems with std::sort 1- std::sort is single threaded 2- std::sort is unable to efficiently sort by multiple columns
by dahfizz 5y ago
The author is pointing out two problems with std::sort
1- std::sort is single threaded
2- std::sort is unable to efficiently sort by multiple columns
- masklinn 5y ago> 1- std::sort is single threaded I would hope it is quite obvious that is not what I have an issue with. > 2- std::sort is unable to efficiently sort by multiple columns It's asserting that with an explanation which is not one, and I'm asking what it is actually saying. "unable to efficiently sort by multiple columns because function call overhead would quickly dominate sorting time." is not an actual explanation.
- dragontamer 5y agoHmmm. std::sort is a template in C++. Which means that in most cases, I'd expect std::sort to inline the comparator and not have any function call overhead at all. (And even further: that the optimizer can make optimizations to std::sort + comparator together since they've been inlined) So you have a good point. Function overhead is in qsort, not in std::sort. The line reads kinda nonsensically to me now that I think of it.
- deleted 5y ago[deleted]