Nothing Special   »   [go: up one dir, main page]

skip to main content
10.5555/2790174.2790180guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
research-article
Free access

Multi-pivot quicksort: theory and experiments

Published: 05 January 2014 Publication History

Abstract

The idea of multi-pivot quicksort has recently received the attention of researchers after Vladimir Yaroslavskiy proposed a dual pivot quicksort algorithm that, contrary to prior intuition, outperforms standard quicksort by a a significant margin under the Java JVM [10]. More recently, this algorithm has been analysed in terms of comparisons and swaps by Wild and Nebel [9]. Our contributions to the topic are as follows. First, we perform the previous experiments using a native C implementation thus removing potential extraneous effects of the JVM. Second, we provide analyses on cache behavior of these algorithms. We then provide strong evidence that cache behavior is causing most of the performance differences in these algorithms. Additionally, we build upon prior work in multi-pivot quicksort and propose a 3-pivot variant that performs very well in theory and practice. We show that it makes fewer comparisons and has better cache behavior than the dual pivot quicksort in the expected case. We validate this with experimental results, showing a 7--8% performance improvement in our tests.

References

[1]
Martin Aumüller and Martin Dietzfelbinger. Optimal partitioning for dual pivot quicksort. CoRR, abs/1303.5217, 2013.
[2]
Pascal Hennequin. Combinatorial analysis of quicksort algorithm. Informatique théorique et applications, 23(3):317--333, 1989.
[3]
C. A. R. Hoare. Quicksort. Comput. J., 5(1):10--15, 1962.
[4]
Anthony LaMarca and Richard E. Ladner. The influence of caches on the performance of sorting. J. Algorithms, 31(1):66--104, 1999.
[5]
D. A. Patterson and J. L. Hennessy. Computer Architecture: A Quantitative Approach. Morgan Kaufmann, 1996.
[6]
Robert Sedgewick. The analysis of quicksort programs. Acta Inf., 7:327--355, 1977.
[7]
Robert Sedgewick and Jon Bentley. Quicksort is optimal. http://www.cs.princeton.edu/~rs/talks/QuicksortIsOptimal.pdf, 2002. {Online; accessed 21-April-2013}.
[8]
Kok-Hooi Tan. An asymptotic analysis of the number of comparisons in multipartition quicksort. 1993.
[9]
Sebastian Wild and Markus E. Nebel. Average case analysis of java 7's dual pivot quicksort. In Leah Epstein and Paolo Ferragina, editors, ESA, volume 7501 of Lecture Notes in Computer Science, pages 825--836. Springer, 2012.
[10]
Vladimir Yaroslavskiy. Dual-pivot quicksort. http://iaroslavski.narod.ru/quicksort/DualPivotQuicksort.pdf, 2009. {Online; accessed 21-April-2013}.

Cited By

View all
  • (2019)BlockQuicksortACM Journal of Experimental Algorithmics10.1145/327466024(1-22)Online publication date: 30-Jan-2019
  • (2018)Quantifying algorithmic improvements over timeProceedings of the 27th International Joint Conference on Artificial Intelligence10.5555/3304652.3304728(5165-5171)Online publication date: 13-Jul-2018
  • (2016)A Comparison of Sorting Times between Java 8 and Parallel ColtACM SIGSOFT Software Engineering Notes10.1145/2967307.296731641:4(1-5)Online publication date: 19-Aug-2016
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Guide Proceedings
Proceedings of the Meeting on Algorithm Engineering & Expermiments
January 2014
165 pages

Publisher

Society for Industrial and Applied Mathematics

United States

Publication History

Published: 05 January 2014

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)30
  • Downloads (Last 6 weeks)7
Reflects downloads up to 14 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2019)BlockQuicksortACM Journal of Experimental Algorithmics10.1145/327466024(1-22)Online publication date: 30-Jan-2019
  • (2018)Quantifying algorithmic improvements over timeProceedings of the 27th International Joint Conference on Artificial Intelligence10.5555/3304652.3304728(5165-5171)Online publication date: 13-Jul-2018
  • (2016)A Comparison of Sorting Times between Java 8 and Parallel ColtACM SIGSOFT Software Engineering Notes10.1145/2967307.296731641:4(1-5)Online publication date: 19-Aug-2016
  • (2016)How Good Is Multi-Pivot Quicksort?ACM Transactions on Algorithms10.1145/296310213:1(1-47)Online publication date: 10-Oct-2016
  • (2015)Analysis of branch misses in quicksortProceedings of the Meeting on Analytic Algorithmics and Combinatorics10.5555/2790216.2790227(114-128)Online publication date: 4-Jan-2015
  • (2015)Optimal Partitioning for Dual-Pivot QuicksortACM Transactions on Algorithms10.1145/274302012:2(1-36)Online publication date: 17-Nov-2015

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media