
Smoothsort Demystified (2011) - csdrane
http://www.keithschwarz.com/smoothsort/
======
vinkelhake
I was curious to see its performance. I found this page that benchmarks
Keith's implementation with an implementation of std::sort and timsort.

In that test, it was thoroughly beaten in all benchmarks. The issue seems to
be that it isn't cache friendly.

[https://www.gamasutra.com/view/news/172542/Indepth_Smoothsor...](https://www.gamasutra.com/view/news/172542/Indepth_Smoothsort_vs_Timsort.php)

------
gnulinux
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't that popular any more since they're not cache friendly. To see that,
observe that in the article author maintains bunch of heaps in the array and
even though it's asymptotically fast and in-place, you'll have to keep
referring to distant parts of the array, causing cache misses.

------
User23
As the author notes, Dijkstra's paper is a bit of a challenge, but it's well
worth reading:
[https://www.cs.utexas.edu/users/EWD/transcriptions/EWD07xx/E...](https://www.cs.utexas.edu/users/EWD/transcriptions/EWD07xx/EWD796a.html).
It's a great example of deriving an algorithm from a predicated acceptance
state.

