testing for fun

JavaScript performance comparison

Test case created

Preparation code

<script src='http://underscorejs.org/underscore-min.js'></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
catch variable
var array = ['hello', 'new', 'day', 'bla'];
        _.each([0, 1, 2], function(idx){
                var _this = this;
                console.log(_this[idx]);
        }, array); // hello new day
pending…
no catch variable
var array = ['hello', 'new', 'day', 'bla'];
        _.each([0, 1, 2], function(idx){
               
                console.log(this[idx]);
        }, array); // hello new day
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