local vs function param (v4)

Revision 4 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(['a', 'b', 'c'], {
 a: "A",
 b: "B",
 c: "c"
});
ready
function param
test1(['a', 'b', 'c'], {
 a: "A",
 b: "B",
 c: "c"
});
ready

Revisions

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