native vs. array.js vs. underscore vs lo-dash

JavaScript performance comparison

Revision 31 of this test case created by dev and last updated

Info

This test compares the performance of a native array vs. underscore vs lo-dash

Preparation code

<script src="//cdn.rawgit.com/jashkenas/underscore/1.6.0/underscore.js"></script>
<script>
var underscore = _.noConflict();
</script>
<script src="//cdn.rawgit.com/lodash/lodash/4cd0297be4c4298d58e53c3885fdea062b38ca7a/dist/lodash.js"></script>
<script>
var lodash = _.noConflict();
</script>
<script>
Benchmark.prototype.setup = function() {
    var arr = underscore.shuffle(underscore.range(50));
};
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
native
var r = arr.map(function(num) {
  return num * num;
});
pending…
underscore
var r = underscore.map(arr, function(num) {
  return num * num;
});
pending…
lo-dash
var r = lodash.map(arr, function(num) {
  return num * num;
});
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment