Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Making Array Range
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 127
Operating system:
Android
Device Platform:
Mobile
Date tested:
13 days ago
For loop
12.1M/s
UIntArray
1.5M/s
Generator
185K/s
View exact numbers
Test name
Executions per second
✓
For loop
12,111,528 Ops/sec
UIntArray
1,471,261 Ops/sec
Generator
185,011 Ops/sec
Script Preparation code:
function* rangeGenerator(end, start = 0) { yield start if (start === end) return yield* rangeGenerator(end, start + 1) }
Tests:
Generator
const result = Array.from(rangeGenerator(20))
For loop
const result = [] for (let i = 0; i < 21; ++i) { result.push(i) }
UIntArray
Array.from(new Uint8Array(21).map((_, i) => i))