pre allocate array

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
pre
const newArray = new Array(5000);
for (let i=0; i<5000; i++) {
	newArray.push(i)
}
ready
nopre
const newArray = []
for (let i=0; i<5000; i++) {
	newArray.push(i)
}
ready

Revisions

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