Analysis of Branch Misses in Quicksort



Martínez, Conrado, Nebel, Markus E and Wild, Sebastian ORCID: 0000-0002-6061-9177
(2014) Analysis of Branch Misses in Quicksort. .

[img] Text
martinez-nebel-wild-2015.pdf - Accepted Version

Download (4MB) | Preview

Abstract

The analysis of algorithms mostly relies on counting classic elementary operations like additions, multiplications, comparisons, swaps etc. This approach is often sufficient to quantify an algorithm's efficiency. In some cases, however, features of modern processor architectures like pipelined execution and memory hierarchies have significant impact on running time and need to be taken into account to get a reliable picture. One such example is Quicksort: It has been demonstrated experimentally that under certain conditions on the hardware the classically optimal balanced choice of the pivot as median of a sample gets harmful. The reason lies in mispredicted branches whose rollback costs become dominating. In this paper, we give the first precise analytical investigation of the influence of pipelining and the resulting branch mispredictions on the efficiency of (classic) Quicksort and Yaroslavskiy's dual-pivot Quicksort as implemented in Oracle's Java 7 library. For the latter it is still not fully understood why experiments prove it 10% faster than a highly engineered implementation of a classic single-pivot version. For different branch prediction strategies, we give precise asymptotics for the expected number of branch misses caused by the aforementioned Quicksort variants when their pivots are chosen from a sample of the input. We conclude that the difference in branch misses is too small to explain the superiority of the dual-pivot algorithm.

Item Type: Conference or Workshop Item (Unspecified)
Additional Information: to be presented at ANALCO 2015
Uncontrolled Keywords: cs.DS, cs.DS, math.PR
Depositing User: Symplectic Admin
Date Deposited: 21 Oct 2019 14:08
Last Modified: 28 Apr 2022 21:12
Related URLs:
URI: https://livrepository.liverpool.ac.uk/id/eprint/3058959