push vs concat

Benchmark created on


Setup

const arr = Array(150000).fill(0);

Test runner

Ready to run.

Testing in
TestOps/sec
push
const arr2 = [];
arr2.push(...arr);
ready
concat
const arr2 = [];
const res = arr2.concat(arr);
ready

Revisions

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