Array Performance (v175)

Revision 175 of this benchmark created on


Description

Manual array lookups vs. holey arrays.

Setup

var a["4096"] = 1;
   var b = new Array();
   for(var i = 0; i < 4096; i++) {
     b[i] = 0;
}
b[4095] = 1;

Test runner

Ready to run.

Testing in
TestOps/sec
Manual Array Lookup
var result = a["4096"];
ready
Holey Array by Index
for(var i = 0; i < 4096; i++) {
   if(b[i] == 1) {
    var result = b[i];
}
}
ready

Revisions

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