Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array/Set/Map/ Iteration
(version: 0)
Comparing performance of:
Array Iteration vs Map Iteration vs Map Iteration (keys) vs Map Iteration (values) vs Set Iteration
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var obj = {"one": true, "two": true, "three": true, "four": true, "five": true, "six": true, "seven": true, "eight": true, "nine": true, "ten": true}; var map = new Map([["one", true], ["two", true], ["three", true], ["four", true], ["five", true], ["six", true], ["seven", true], ["eight", true], ["nine", true], ["ten", true]]); var arr = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]; var set = new Set(["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]);
Tests:
Array Iteration
for (const element of arr) { void(element); }
Map Iteration
for (const element of map) { void(element); }
Map Iteration (keys)
for (const element of map.keys()) { void(element); }
Map Iteration (values)
for (const element of map.values()) { void(element); }
Set Iteration
for (const element of set) { void(element); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
Array Iteration
Map Iteration
Map Iteration (keys)
Map Iteration (values)
Set Iteration
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Array/Set/Map/Object Iteration
Array/Set/Map/Object Iteration 2
Array + map vs array iteration
Array/Set/Map/Object Iteration with entries
Comments
Confirm delete:
Do you really want to delete benchmark?