array-length-vs-pop

Benchmark created on


Setup

const x = Array.from({ length: 1000 }, (_, i) => i)

Test runner

Ready to run.

Testing in
TestOps/sec
length
x.length = 0
const _ = x[0]
ready
pop
while(x.length) x.pop()
const _ = x[0]
ready

Revisions

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