Array Augmentation (v3)

Revision 3 of this benchmark created by John-David Dalton on


Setup

var source = Array(1001).join('x').split('');

  Benchmark.prototype.setup = function() {
    var target,
        source = window.source;
  };

Test runner

Ready to run.

Testing in
TestOps/sec
Individual Push
target = [1, 2, 3, 4, 5];
for ( var i = 0; i < source.length; i++ ) {
    target.push( source[i] );
}
ready
Variadic Push
target = [1, 2, 3, 4, 5];
target.push.apply(target, source);
ready

Revisions

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

  • Revision 3: published by John-David Dalton on