Array clear methods (v28)

Revision 28 of this benchmark created on


Setup

var a = [];
  for (i = 1; i < 100000; i++) {
    a.push({a: 1, b: "2"});
  }

Test runner

Ready to run.

Testing in
TestOps/sec
redefine
a = [];
ready
length=0
a.length = 1;
a.length = 0;
ready
a.pop();
while(a.length ) {
    a.pop();
}
ready
a.splice(0,a.length)
a.splice(0,a.length)
ready

Revisions

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