Sorting Algorithms and Browser Implementations

I had the privilege of attending jsDay last week in Verona, Italy. One of my favorite talks during the two-day event was titled “CS101 Intro to Computational Complexity: The Sorting Problem” by Claudia Hernández.

When calling Array.prototype.sort(), I (as I suspect many of you) had no idea exactly what the magicians under-the-hood were doing with my array. All I knew was that if I didn’t pass proper instructions to the method, I didn’t always get back the results I was expecting.

The crux of the talk revolved around the various different sorting algorithms that each of the major browser vendors use (MergeSort, QuickSort, and InsertionSort) for the native .sort() method and how each of those algorithms perform under various different conditions (sorting an array of 10 items, 100 items, etc. up to 10 million items).

I highly recommend taking a look through the slides. I’ll be sure to update this post if/when a video of the talk becomes available.

Jon Bellah I am a full-stack web developer, speaker, and occasional writer. I live in the beautiful city of Denver, Colorado. I am currently employed as a Lead Front-End Engineer at 10up. You can follow me on Twitter at @jonbellah.