Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Iterator map vs Array map
(version: 1)
Comparing performance of:
Iterator vs Array
Created:
11 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
Tests:
Iterator
array.values().map(item => item * 2).map(item => item ** 2).reduce((a, b) => a + b)
Array
array.map(item => item * 2).map(item => item ** 2).reduce((a, b) => a + b)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Iterator
Array
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36 Edg/146.0.0.0
Browser/OS:
Chrome 146 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Iterator
1861338.0 Ops/sec
Array
3869211.2 Ops/sec
Related benchmarks:
map vs reduce
for vs foreach vs map vs (map, filter reduce)
Array reduce with nested spread vs map and push
Array reduce with nested spread vs foreach and push
Array reduce with nested spread vs foreach and push 2
map vs reduce
Array merge
JS iterator vs array
JS iterator vs array (big)
Comments
Confirm delete:
Do you really want to delete benchmark?