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:
28 days ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:149.0) Gecko/20100101 Firefox/149.0
Browser/OS:
Firefox 149 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array
9416.0 Ops/sec
Iterator
686.3 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?