4 ms·
fwiw, on linux with g++-4.8.2: qsort: 4415 ms std::sort: 4413 ms Some comments: 1.) std::sort doesn't require twice as many comparisons 2.) You not only hav
by btmorex 12y ago
fwiw, on linux with g++-4.8.2:
qsort: 4415 ms
std::sort: 4413 ms
Some comments:
1.) std::sort doesn't require twice as many comparisons
2.) You not only have a vector with equal items, you have a vector of the same item repeated. That removes all data cache issues which I think is generally unrealistic and unfair.
3.) An already sorted vector is not only pathological, it's something that you usually need to optimize for (probably both qsort and std::sort are bad choices)