TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Smoothsort Demystified (2011)

97 pointsby csdraneover 6 years ago

3 comments

vinkelhakeover 6 years ago
I was curious to see its performance. I found this page that benchmarks Keith&#x27;s implementation with an implementation of std::sort and timsort.<p>In that test, it was thoroughly beaten in all benchmarks. The issue seems to be that it isn&#x27;t cache friendly.<p><a href="https:&#x2F;&#x2F;www.gamasutra.com&#x2F;view&#x2F;news&#x2F;172542&#x2F;Indepth_Smoothsort_vs_Timsort.php" rel="nofollow">https:&#x2F;&#x2F;www.gamasutra.com&#x2F;view&#x2F;news&#x2F;172542&#x2F;Indepth_Smoothsor...</a>
gnulinuxover 6 years ago
Awesome article. This is what I want to see in HN every day, very interesting and relatively unknown CS topic, well explained, easy to understand, well written code. Basically flawless. Unfortunately, HeapSort and its variants aren&#x27;t that popular any more since they&#x27;re not cache friendly. To see that, observe that in the article author maintains bunch of heaps in the array and even though it&#x27;s asymptotically fast and in-place, you&#x27;ll have to keep referring to distant parts of the array, causing cache misses.
User23over 6 years ago
As the author notes, Dijkstra&#x27;s paper is a bit of a challenge, but it&#x27;s well worth reading: <a href="https:&#x2F;&#x2F;www.cs.utexas.edu&#x2F;users&#x2F;EWD&#x2F;transcriptions&#x2F;EWD07xx&#x2F;EWD796a.html" rel="nofollow">https:&#x2F;&#x2F;www.cs.utexas.edu&#x2F;users&#x2F;EWD&#x2F;transcriptions&#x2F;EWD07xx&#x2F;E...</a>. It&#x27;s a great example of deriving an algorithm from a predicated acceptance state.