4 ms·
Well, perhaps I'm not terribly up-to-date on the issues I mentioned third, either. FWIW, there is a comment on why GNU libc defaults to Merge Sort for qsort() o
by ggchappell 12y ago
Well, perhaps I'm not terribly up-to-date on the issues I mentioned third, either. FWIW, there is a comment on why GNU libc defaults to Merge Sort for qsort() on Reddit:
> The reason we made qsort() default to using merge sort was, indeed, that it always makes fewer compares than quick sort. We thought that in the common case, people would sort small objects (numbers, pointers) rather than large objects, and that therefore the performance would be dominated by comparisons rather than data movement.
Link to full comment: http://www.reddit.com/r/programming/comments/1jxq4/ask_reddit_why_does_the_gnu_libc_use_mergesort_to/c1k07v http://www.reddit.com/r/programming/comments/1jxq4/ask_reddi...
Since you say "pivot sits in a register", you're also talking about very small data. It looks to me like the two of you disagree. (OTOH, that comment was 7 years ago.)