Empty array (v111)

Revision 111 of this benchmark created by Russell Dempsey on


Setup

var arr = [];
    
    for(var i = 0; i < 100000; i++) {
      arr[i] = {};
      arr[i].a = 1;
      arr[i].b = '2';
    }

Test runner

Ready to run.

Testing in
TestOps/sec
length
arr.length = 0;
ready
splice
arr.splice(0, arr.length);
ready
pop
while (arr.length > 0) {
  arr.pop();
}
ready
shift
while (arr.length > 0) {
  arr.shift();
}
ready
new
arr = []
ready

Revisions

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