Array clear methods (v23)

Revision 23 of this benchmark created on


Setup

var a = [];
  for (i = 1; i < 10000; i++) {
    a.push(i);
  }

Test runner

Ready to run.

Testing in
TestOps/sec
redefine
// async test
a = [];
ready
length=0
// async test
a.length = 0;
ready
a.pop();
// async test
while(a.length > 0) {
    a.pop();
}
ready
a.splice(0,a.length)
// async test
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.