Adding items to smi array (v4)

Revision 4 of this benchmark created on


Setup

let one = [...Array(1000).keys()]
let two = [...Array(500).keys()]

Test runner

Ready to run.

Testing in
TestOps/sec
push (spread)
one.push(...two)
ready
push (apply)
Array.prototype.push.apply(one, two)
ready
push (for)
for (let i = 0; i < two.length; i++) one.push(two[i])
ready
push (for...of)
for (const i of two) one.push(i)
ready
copy (concat, assign)
one = one.concat(two)
ready
copy (spread, assign)
one = [...one, ...two]
ready
copy (concat, declare)
let three = one.concat(two)
ready

Revisions

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