typedarrays: fill vs for loop

Benchmark created on


Description

compare the perf btw fill method and a classic for loop to set a unique value

Setup

let data = new Int32Array(100000);

Test runner

Ready to run.

Testing in
TestOps/sec
Fill
data.fill(-1);
ready
For loop
for(let i=0; i<100000; i++) {
	data[i] = -1;
}
ready

Revisions

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