Test array element removal (v2)

Revision 2 of this benchmark created on


Setup


Test runner

Ready to run.

Testing in
TestOps/sec
Assign (can't be const)
a = [...Array(1000).keys()].map((key) => ({x:key+1}))
a = []
ready
Splice
a = [...Array(1000).keys()].map((key) => ({x:key+1}))
a.splice(0, a.length)
ready
Length (ick)
a = [...Array(1000).keys()].map((key) => ({x:key+1}))
a.length = 0
ready
Pop
a = [...Array(1000).keys()].map((key) => ({x:key+1}))
while (a.length) { a.pop() }
ready

Revisions

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