native sort vs underscore sortBy (v6)

Revision 6 of this benchmark created on


Preparation HTML

<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>

<script>
  var a = [{name:"elliot"}, {name:"steve"}, {name:"dhruv"}, {name:"guiga"}, {name:"rajat"}, {name:"rob"}]
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
native sort
a.sort(function(a, b) {
 return a.name <= b.name ? -1 : 1;
});
ready
underscore sortBy
_(a).sortBy(function(label) {
    return label.name;
});
ready

Revisions

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