Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JS iterator vs array x
(version: 1)
Comparing performance of:
Array vs Iterator
Created:
5 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const items = [1,2,3,4,5,6,7,8,9,10];
Tests:
Array
const arrayTransform = items.filter(i => i % 2 === 0).map(n => n * 2);
Iterator
const iterTransform = items.values().filter(i => i % 2 === 0).map(n => n * 2);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array
Iterator
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array
16471496.0 Ops/sec
Iterator
20315464.0 Ops/sec
Related benchmarks:
for loop push vs mapFilter
for vs for...of vs Array.forEach
Iterate Array.from(n, () => {}) vs [...Array(n)]
javascript rulettaa
javascript ruletz
Iterators vs Arrays
JS iterator vs array
JS iterator vs array (big)
Iterator map vs Array map
Comments
Confirm delete:
Do you really want to delete benchmark?