Array push vs. concat

Benchmark created by Maciej Małecki on


Setup

var a = [1, 2, 3, 4, 5];
    var b = [9, 8, 7, 6];

Test runner

Ready to run.

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

Revisions

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

  • Revision 1: published by Maciej Małecki on