Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Iterators vs Arrays
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
Arrays
2853.4 Ops/sec
Iterator
3298.4 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Tests:
Arrays
const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]; arr.filter(n => n % 2 === 0).map(n => ({ result: n })).forEach(n => console.log("n = ", n));
Iterator
const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]; const iterator = Iterator.from(arr); iterator.filter(n => n % 2 === 0).map(n => ({ result: n })).forEach(n => console.log("n = ", n));