test23452345234a

Benchmark created by Oden on


Preparation HTML

<script>
var list = [];
var dict = {};

for(var i = 0; i < 1000000; i++) {
 list.push({ a: i, b: i+1,c: i+2,d: i+3,e: i+4 });
 dict[i] = { a: i, b: i+1,c: i+2,d: i+3,e: i+4 };
}

function findTestArr(x) {
  for (var i = 0; i < list.length; i++)
    if (list[i].a == x)
      return list[i];
}

function findTestDict(x) {

  if (dict[x] && dict[x].a == x)
    return dict[x];
}

</script>

Test runner

Ready to run.

Testing in
TestOps/sec
arr
findTestArr(1);
findTestArr(100);
findTestArr(1000);
findTestArr(9898);
findTestArr(98980);
findTestArr(989800);
ready
dict
findTestDict(dict, 1);
findTestDict(dict, 100);
findTestDict(dict, 1000);
findTestDict(dict, 9898);
findTestDict(dict, 98980);
findTestDict(dict, 989800);
ready

Revisions

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

  • Revision 1: published by Oden on