Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
iterate over map vs array-backed map
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Browser:
Chrome 138
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
6 months ago
Test name
Executions per second
map
18945658.0 Ops/sec
array-backed map
53697336.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const map = new Map([[1,null],[2, null],[3, null],[4, null]]) const array = [1,2,3,4] const mapWithArray = new Map([[1,null],[2, null],[3, null],[4, null]]) function getStructures() { return { map, array, mapWithArray } }
Tests:
map
const {map, array, mapWithArray} = getStructures() for (const [key, value] of map) { key; value; }
array-backed map
const {map, array, mapWithArray} = getStructures() for (const key of array) { key; mapWithArray.get(key) }