2 ms·
The author appears to be completely wrong. While the spec doesn't say anything about the expected performance, there's no way a real Javascript implementation
by dalke 13y ago
The author appears to be completely wrong.
While the spec doesn't say anything about the expected performance, there's no way a real Javascript implementation uses an O(n * n) algorithm.
Indeed, http://blog.rodneyrehm.de/archives/14-Sorting-Were-Doing-It-Wrong.html http://blog.rodneyrehm.de/archives/14-Sorting-Were-Doing-It-... a couple of years ago wrote "While InsertionSort and MergeSort (Apple and Mozilla) are stable, QuickSort (Google Chrome) is not (Issue 90). Chrome will sort arrays using InsertionSort if the array has 10 or less elements" and http://stackoverflow.com/questions/234683/javascript-array-sort-implementation http://stackoverflow.com/questions/234683/javascript-array-s... agrees. http://webreflection.blogspot.se/2009/04/internet-explorer-and-its-inefficient.html http://webreflection.blogspot.se/2009/04/internet-explorer-a... extends the comparison to IE and Opera, showing that they are also n * log n implementations.