Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JS iterator vs array (big)
(version: 1)
Comparing performance of:
Array vs Iterator
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const items = Array(10000).fill(0).map((_, i) => i);
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).toArray();
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:
one month ago
)
User agent:
Mozilla/5.0 (Android 16; Mobile; rv:150.0) Gecko/150.0 Firefox/150.0
Browser/OS:
Firefox Mobile 150 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array
7521.2 Ops/sec
Iterator
718.4 Ops/sec
Related benchmarks:
for vs foreach vs map vs for..of
for loop push vs mapFilter
for vs. map
For i / For of / ForEach
iterate over array
Array loop vs foreach vs map into array 2
javascript rulettaa
javascript ruletz
JS iterator vs array
Comments
Confirm delete:
Do you really want to delete benchmark?