local vs function param2 (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script>
  test1 = function(someArray, someObj) {
   for (var i = 0, ii = someArray.length; i < ii; i++) {
    var text = someObj[someArray[i]];
    // do something with text
   }
  };
  test2 = function(someArray, someObj, i, ii, text) {
   for (i = 0, ii = someArray.length; i < ii; i++) {
    text = someObj[someArray[i]];
    // do something with text
   }
  };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
local
test1([0, 1, 2], {
 'a', 'b', 'c'
});
ready
function param
test1([0, 1, 2], {
 'a', 'b', 'c'
});
ready

Revisions

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