3 ms·
A while ago I was tinkering with Quicksort and avoiding branch mispredictions. https://easylang.online/blog/qsort_c.html https://easylang.online/blog/qsort_c.h
by chkas 5y ago
A while ago I was tinkering with Quicksort and avoiding branch mispredictions.
https://easylang.online/blog/qsort_c.html https://easylang.online/blog/qsort_c.html
My implementation is pretty fast. At a size of 40 or 50, I switch to Insertion sort, and there the branchless bubblesort is significantly slower (I just tried it).
But I have to admit defeat to this Sample sort:
https://github.com/SaschaWitt/ips4o https://github.com/SaschaWitt/ips4o