pop vs shift

Benchmark created by Igor Minar on


Setup

var a, i;
  
  Benchmark.prototype.setup = function() {
   a = [];
   for (i = 0; i < this.count; i++) {
    a.push(i);
   }
  }

Test runner

Ready to run.

Testing in
TestOps/sec
pop
a.pop();
ready
shift
a.shift();
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