Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.fill vs Array.push vs String.repeat vs Array.set
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 12; Mobile; rv:141.0) Gecko/141.0 Firefox/141.0
Browser:
Firefox Mobile 141
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
String.repeat
5.2M/s
Array.push
38/s
Array.fill
36/s
Array.set
6/s
View exact numbers
Test name
Executions per second
✓
String.repeat
5,208,438 Ops/sec
Array.push
38 Ops/sec
Array.fill
36 Ops/sec
Array.set
6 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Tests:
Array.fill
var array = Array(1920*1080).fill("\u001b[0m")
Array.push
var array = [] for (let i = 1920 * 1080; i > 0; i--) array.push("\u001b[0m")
String.repeat
var repeat = "\u001b[0m".repeat(1920 * 1080)
Array.set
var array = Array(1920*1080) for (let i = 1920 * 1080; i > 0; i--) array[i] = "\u001b[0m"