CS101 Intro to Computational Complexity: The Sorting Problem
summary
Browser engines implement different algorithms: merge sort + insertion sort in SpiderMonkey, V8 uses quicksort with insertion sort for small arrays, Chakra also favors quicksort. Native Array#sort is not guaranteed stable and often compares as strings. Benchmarks on the presenter’s machine show insertion sort faster than native up to ~1,000 items, quicksort beating native from ~100,000 onward, insertion freezing at 1,000,000, and JS-hosted implementations yielding measurable speed differences.
AI-written summary · about
chapters (8)
- 0:00Start
- 1:16Array#sort in JS
- 9:23Insertion Sort
- 11:40Performance
- 12:05Merge Sort
- 15:03Quick Sort
- 22:0410,000,000 elements
- 22:41Certificate of Excellence
related talks
28mHow to sort your socks using Javascript
23mHow to Sort Your Socks Using JavaScript
04mquick-bench.com
39mHow much performance can you get out of Javascript?
57mDown the Rabbit Hole: JavaScript in Wonderland
18mJSConf 2015 John David Dalton
23mJavaScript Engines: The Good Parts™
39mAlgorithms in the Front End: from V8 to VDOM
