Array Sort vs. lodash sort (v9)

Revision 9 of this benchmark created on


Preparation HTML

<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>

Setup

var array = [514, -284, 433, -587, -244, -471, -524, -760, -641, -208, -38, 142, 252, 392, -994, 859, 439, 608, 610, 1000, 334, 859, -865, -392, 957, 753, 889, 402, 382, 698, 770, 118, 129, 143, 760, -350, 272, 689, 753, -822, 940, -208, -944, -804, -983, -856, 910, 366, -752, -155, -127, -695, 874, -37, 289, -57, -346, -309, 654, -667, -565, -851, 577, 103, 404, -995, 884, -328, 928, -111, 507, 219, 524, -99, -220, 861, -214, 985, -817, 920, -678, -917, 353, -454, -306, 329, -788, 599, -566, 215, -366, -319, -320, -709, -159, 45, -351, 592, 778, 943];

Test runner

Ready to run.

Testing in
TestOps/sec
JS Array sort
Array.prototype.slice.call(array).sort(function compare(a, b) { return a - b });
ready
loDash
_.sortBy(array);
ready

Revisions

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