Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
set vs array iteration for,for-of and values v3
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
array for-of
519681.2 Ops/sec
set for-of
108421.9 Ops/sec
array for
919.2 Ops/sec
set values for-of
109745.1 Ops/sec
Script Preparation code:
var a = []; for (var i = 0; i <= 10000; i++) { a.push(i); } var b = new Set(a);
Tests:
array for-of
for (const x of a) { let z = x; }
set for-of
for (const x of b) { let z = x; }
array for
for (let i = 0; i < a.length; i++) { let x = a[i]; }
set values for-of
const v = b.values(); for (const x of v) { let z = x }