underscore each vs underscore reduce

JavaScript performance comparison

Test case created

Preparation code

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

<script>
  var pi = Math.PI
  var a = new Array(100000),
      e;
</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
underscore.each
_.each(a, function(item) {
  e = pi;
});
pending…
underscore.reduce
_.reduce(a, function(item) {
  e = pi;
});
pending…

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

Compare results of other browsers

0 comments

Add a comment