Array performance

Benchmark created on


Description

Test array filling

Test runner

Ready to run.

Testing in
TestOps/sec
const arr - push method
let count = 10000;
const arr = [];

for(let i = 0; i < count; i++){
	arr.push(i*2);
}
ready
let arr - push method
let count = 10000;
let arr = [];

for(let i = 0; i < count; i++){
	arr.push(i*2);
}
ready
const arr - position
let count = 10000;
const arr = Array(count);

for(let i = 0; i < count; i++){
	arr[i] = i*2;
}
ready
let arr - position
let count = 10000;
let arr = Array(count);

for(let i = 0; i < count; i++){
	arr[i] = i*2;
}
ready

Revisions

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