<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>BlockQuicksort: How Branch Mispredictions don't affect Quicksort · HackerPapers discussions</title><link>https://hackerpaper.kaipfister.de/p/1604.06697/</link><description>Collected HN comments and submissions linking this paper.</description><language>en</language><lastBuildDate>Mon, 02 Nov 2026 11:16:22 GMT</lastBuildDate><atom:link href="https://hackerpaper.kaipfister.de/p/1604.06697/feed.xml" rel="self" type="application/rss+xml" /><item><title>BlockQuicksort: How Branch Mispredictions don't affect Quicksort — mentioned by Voultapher</title><link>https://news.ycombinator.com/item?id=36275248</link><guid isPermaLink="false">urn:hackerpapers:mention:1604.06697:36275248</guid><pubDate>Sat, 10 Jun 2023 21:22:27 GMT</pubDate><description>&lt;p&gt;Ok so both the things you linked are not my ideas. The first one is AFAIK originally from the BlockQuicksort paper https://arxiv.org/pdf/1604.06697.pdf section 3.2. Which Orson Peters used in his pdqsort, which I know base ipnsort on. The second one is from Igor van den Hoven in his work on quadsort as I mention in the function description. Really a lot of this stuff is building on top of other peoples work and refining it. Seemingly I&amp;#x27;m the first to write neat little ASCII graphics for them in the code making them easier to approach. There are some novel ideas by me in there too though, for…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/1604.06697/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>BlockQuicksort: How Branch Mispredictions don't affect Quicksort — mentioned by sanxiyn</title><link>https://news.ycombinator.com/item?id=35889886</link><guid isPermaLink="false">urn:hackerpapers:mention:1604.06697:35889886</guid><pubDate>Wed, 10 May 2023 16:44:17 GMT</pubDate><description>&lt;p&gt;Theoretical advances are constant (just check the literature), but two particular advances in the last decade are of practical importance: one for sort and one for hash table. As in: check the implementation you are using, if it doesn&amp;#x27;t incorporate these advances you are leaving substantial performance (2x is not out of the question) on the table. How Branch Mispredictions don&amp;#x27;t affect Quicksort (2016) https://arxiv.org/abs/1604.06697 Quicksort is still the algorithm of choice for general purpose internal unstable sort. In modern hardwares, quicksort spends a lot of time recovering from…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/1604.06697/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>BlockQuicksort: How Branch Mispredictions don't affect Quicksort — mentioned by nightcracker</title><link>https://news.ycombinator.com/item?id=27874177</link><guid isPermaLink="false">urn:hackerpapers:mention:1604.06697:27874177</guid><pubDate>Sun, 18 Jul 2021 16:23:46 GMT</pubDate><description>&lt;p&gt;This article is missing the important reference to the prior work by Edelkamp and Weiss, on branchless quicksort [1]. I&amp;#x27;ve long since implemented that in pdqsort [2], along with other techniques described by me in [3] which is a drop-in replacement for std::sort that&amp;#x27;s ~twice as fast as std::sort for small data with branchless comparisons. It&amp;#x27;s also available in Boost.sort [4]. [1] https://arxiv.org/abs/1604.06697 [2] https://github.com/orlp/pdqsort [3] https://arxiv.org/abs/2106.05123 [4] https://www.boost.org/doc/libs/1_76_0/libs/sort/doc/html/sor...&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/1604.06697/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>BlockQuicksort: How Branch Mispredictions don't affect Quicksort — mentioned by lorenzhs</title><link>https://news.ycombinator.com/item?id=17884612</link><guid isPermaLink="false">urn:hackerpapers:mention:1604.06697:17884612</guid><pubDate>Fri, 31 Aug 2018 11:28:11 GMT</pubDate><description>&lt;p&gt;Especially when targeting realistic machine models, there are a lot of things that are suboptimal about the classical sorting algorithms like quicksort or mergesort. For example, a quicksort with perfect choice of pivot will incur a branch miss with probability 50% for every element. That&amp;#x27;s not something classical complexity analysis measures, but on actual CPUs, branch misses have quite an impact (something like 10–15 cycles). Shameless plug for something I once built for a lecture to demonstrate this: https://github.com/lorenzhs/quicksort-pivot-imbalance For sorting algorithms that take the…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/1604.06697/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>BlockQuicksort: How Branch Mispredictions don't affect Quicksort — mentioned by lorenzhs</title><link>https://news.ycombinator.com/item?id=14669239</link><guid isPermaLink="false">urn:hackerpapers:mention:1604.06697:14669239</guid><pubDate>Fri, 30 Jun 2017 07:59:15 GMT</pubDate><description>&lt;p&gt;To illustrate the point about branch misprediction, I implemented quicksort with intentionally skewed pivot selection. You can see the results here: https://github.com/lorenzhs/quicksort-pivot-imbalance For this demo I&amp;#x27;m sorting a permutation of the range 1 to n, so obtaining perfect or arbitrarily skewed pivots is free, which isn&amp;#x27;t realistic, but that&amp;#x27;s not the point. My experiments show that quicksort is fastest on my machine when 15% of the elements are on one side and 85% on the other. This is a tradeoff between branch prediction (if it always guesses &amp;quot;right side&amp;quot;, it&amp;#x27;s right 85% of the…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/1604.06697/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>BlockQuicksort: How Branch Mispredictions don't affect Quicksort — HN submission</title><link>https://news.ycombinator.com/item?id=11575934</link><guid isPermaLink="false">urn:hackerpapers:submission:1604.06697:11575934</guid><pubDate>Tue, 26 Apr 2016 21:42:26 GMT</pubDate><description>&lt;p&gt;BlockQuicksort: How Branch Mispredictions Don&amp;#x27;t Affect Quicksort&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;3 points; 0 discussion replies on HN. &lt;a href="https://hackerpaper.kaipfister.de/p/1604.06697/"&gt;Paper and source history&lt;/a&gt;. A submission is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item></channel></rss>
