local vs function param

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([1, 2, 3], {});
ready
function param
test2([1, 2, 3], {});
ready

Revisions

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