Javascript native sort method code

Take a look at the WebKit implementation: https://gist.github.com/964673. Apparently, it uses min sort/selection sort. From: http://svn.webkit.org/repository/webkit/trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

SpiderMonkey seems to indeed use MergeSort. See: http://hg.mozilla.org/mozilla-central/file/28be8df0deb7/js/src/jsarray.cpp.

Leave a Comment