Empty array (v66)

Revision 66 of this benchmark created on


Setup

var arr = [];
      for (var i = 0; i < 10000; i++) arr.push({ prop1: i, prop2: i * 2 });
      var doSomething = function(val) {}

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

Revisions

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