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

JavaScript performance comparison

Revision 33 of this test case created by Daniel K

Info

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

Preparation code

<script>
 
  var underscore = document.createElement('script');
  var lodash = document.createElement('script');
  var prelude = document.createElement('script');
  lodash.src = '//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js';
  prelude.src = 'http://www.preludels.com/prelude-browser-min.js';
  document.body.appendChild(lodash);
  document.body.appendChild(prelude);
</script>

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 arr = [1, 2, 3];

arr = arr.map(function(num) {
  return num + num;
});
pending…
lo-dash
var arr = [1, 2, 3];

arr = _.map(arr, function(num) {
  return num + num;
});
pending…
prelude-ls
var arr = [1, 2, 3];
var _prelude = require("prelude-ls")
arr = _prelude.map(function(num) {
  return num + num;
}, arr);
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