push/pop vs unshift/shift (v37)

Revision 37 of this benchmark created on


Setup

var l = [];
  
  for(var i = 0; i < 15; i++)
  {
    l.push(i);
  }

Test runner

Ready to run.

Testing in
TestOps/sec
Reverse Pop
l = l.reverse();

while(l.length)
{
  l.pop();
}
ready
Shift
while(l.length)
{
  l.shift();
}
ready

Revisions

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