local vs function param (v6)

Revision 6 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', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], {
 a: "A",
 b: "B",
 c: "C",
 d: "D",
 e: "E",
 f: "F",
 g: "G",
 h: "H",
 i: "I",
 j: "J",
 k: "K",
 l: "L",
 m: "M",
 n: "N",
 o: "O",
 p: "P",
 q: "Q",
 r: "R",
 s: "S",
 t: "T",
 u: "U",
 v: "V",
 w: "W",
 x: "X",
 y: "Y",
 z: "Z"
});
ready
function param
test2(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'], {
 a: "A",
 b: "B",
 c: "C",
 d: "D",
 e: "E",
 f: "F",
 g: "G",
 h: "H",
 i: "I",
 j: "J",
 k: "K",
 l: "L",
 m: "M",
 n: "N",
 o: "O",
 p: "P",
 q: "Q",
 r: "R",
 s: "S",
 t: "T",
 u: "U",
 v: "V",
 w: "W",
 x: "X",
 y: "Y",
 z: "Z"
});
ready

Revisions

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