Communications of the ACM
Optimal Sampling Strategies in Quicksort and Quickselect
SIAM Journal on Computing
Computer Architecture: A Quantitative Approach
Computer Architecture: A Quantitative Approach
Tradeoffs between branch mispredictions and comparisons for sorting algorithms
WADS'05 Proceedings of the 9th international conference on Algorithms and Data Structures
An experimental study of sorting and branch prediction
Journal of Experimental Algorithmics (JEA)
Algorithm engineering: bridging the gap between algorithm theory and practice
Algorithm engineering: bridging the gap between algorithm theory and practice
Branch mispredictions don't affect mergesort
SEA'12 Proceedings of the 11th international conference on Experimental Algorithms
Hi-index | 0.00 |
We explain the counterintuitive observation that finding "good" pivots (close to the median of the array to be partitioned) may not improve performance of quicksort. Indeed, an intentionally skewed pivot improves performance. The reason is that while the instruction count decreases with the quality of the pivot, the likelihood that the direction of a branch is mispredicted also goes up. We analyze the effect of simple branch prediction schemes and measure the effects on real hardware.