Array Sort vs. lodash sort (v12)

Revision 12 of this benchmark created on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.min.js">
</script>

Setup

var jsArrayTest = [];
    for (var i = 1000; i > 0; i--) {
      jsArrayTest.push([_.random(-1000, 1000), 'foo', 'bar'])
    }
    var lodashArrayTest = _.cloneDeep(jsArrayTest);

Test runner

Ready to run.

Testing in
TestOps/sec
JS Array sort
jsArrayTest.sort();
ready
loDash
var aaa = [2,3,1,6,7,4];

console.log(_.sortBy(aaa));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.