Javascript array concat vs push (v170)

Revision 170 of this benchmark created by Tai Shi Ling on


Setup

var arr1 = Array.from(Array(50000), (x,i) => i + 1)
  var arr2 = Array.from(Array(50000), (x,i) => i - 1)

Test runner

Ready to run.

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

Revisions

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