native map vs underscore map (v4)

Revision 4 of this benchmark created by danvk on


Preparation HTML

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

Setup

var arr = _.range(10);

Test runner

Ready to run.

Testing in
TestOps/sec
Native map
arr.map(function(entry) {
  return entry + 1;
});
ready
Undescore map
_.map(arr, function(entry) {
  return entry + 1;
});
ready
Underscore object map
_(arr).map(function(entry) {
  return entry + 1;
});
ready

Revisions

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