3 ms·
Smoothsort Demystified (2011)
- vinkelhake 8y agoI 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_Smoothsort_vs_Timsort.php https://www.gamasutra.com/view/news/172542/Indepth_Smoothsor...
- gnulinux 8y agoAwesome 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 8y agoAs 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/EWD796a.html https://www.cs.utexas.edu/users/EWD/transcriptions/EWD07xx/E.... It's a great example of deriving an algorithm from a predicated acceptance state.
- deleted 8y ago[deleted]