Test array initialization

Benchmark created on


Setup

const SIZE = 10_000;

Test runner

Ready to run.

Testing in
TestOps/sec
Push iteratively
const arr = []
for (let i = 0; i < SIZE; i++) {
    arr.push(i)
}
ready
Preinit array
const arr = new Array(SIZE).fill(0)
for (let i = 0; i < SIZE; i++) {
    arr[i] = i
}
ready

Revisions

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