&quot;In all seriousness, I just wanted a quick fix to undo the perf regression caused by using std::stable_sort.<p>I filed a bug to fix this: <a href="https:&#x2F;&#x2F;bugs.webkit.org&#x2F;show_bug.cgi?id=150843&quot;" rel="nofollow">https:&#x2F;&#x2F;bugs.webkit.org&#x2F;show_bug.cgi?id=150843&quot;</a><p>From that link<p>&quot;Bug 150843 - Consider something better than bubble sort for insertion sets
achristiansen suggested falling back on stable sort if we do too many passes.  ggaren suggested insertion sort.<p>There&#x27;s also the possibility that we could make merge sort a lot faster, if we didn&#x27;t use system malloc as the temp buffer allocator.&quot;<p>Apparently a really slow merge sort implementation caused a major performance slowdown. Since bubble sort is always taught as a bad sort it&#x27;s kind of funny that he is using it to fix a performance regression. Hence the link and upvotes.