pop vs shift (v3)

Revision 3 of this benchmark created by Igor Minar on


Setup

var a, i;
  
  Benchmark.prototype.setup = function() {
   a = [];
  }

Test runner

Ready to run.

Testing in
TestOps/sec
unshift+pop
a.unshift('x');
a.pop();
ready
push+shift
a.push('x');
a.shift();
ready
push+pop
a.push('x');
a.pop();
ready

Revisions

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

  • Revision 1: published by Igor Minar on
  • Revision 2: published by Igor Minar on
  • Revision 3: published by Igor Minar on