concat push (v9)

Revision 9 of this benchmark created on


Description

Part of the following article: http://wellcaffeinated.net/articles/your-javascript-is-slow-common-and-not-so-common-optimizations

Setup

var a = ['the quick brown fox', 'jumps over the lazy dog'];
    var b = ['and the lazy dog', 'does not mind'];
    var push = Array.prototype.push;

Test runner

Ready to run.

Testing in
TestOps/sec
concat
var c = a.slice();
c.concat(b);
ready
push-apply
var c = a.slice();
Array.prototype.push.apply(c, b);
ready

Revisions

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