Push array onto other

Benchmark created on


Setup

const array = [];
const otherArray = Array.from({length: 150000}, () => 123);

Test runner

Ready to run.

Testing in
TestOps/sec
one by one
for (const val of otherArray) {
	array.push(val)
}
ready
chunks
const CHUNK_SIZE = 4096;
for (let i = 0, l = otherArray.length; i < l; i += CHUNK_SIZE) {
	array.push(...otherArray.slice(i, i + CHUNK_SIZE));
}
ready

Revisions

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