Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Create Array Filled with Undefined
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Browser:
Chrome 102
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Array.fill
37K/s
Custom function
4K/s
Array.apply
4K/s
Array.concat
3K/s
View exact numbers
Test name
Executions per second
✓
Array.fill
36,809 Ops/sec
Custom function
3,946 Ops/sec
Array.apply
3,652 Ops/sec
Array.concat
3,053 Ops/sec
Script Preparation code:
var length = 10000;
Tests:
Array.apply
const array = Array.apply(null, { length });
Array.concat
const array = [].concat.apply([], { length });
Array.fill
const array = []; array.length = length; array.fill(undefined);
Custom function
const func = (...args) => args; func.apply(null, { length });