Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
map vs array accessor
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 26_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Brave/1 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 26
Operating system:
iOS 26.3
Device Platform:
Mobile
Date tested:
2 months ago
Test name
Executions per second
Accessing random index in array
104363.6 Ops/sec
Accessing random index in map
91467.3 Ops/sec
Script Preparation code:
window.ITEMS_ARRAY = Array(1000).fill(null).map((item, index) => { return { id: index, name: '10 Portable DVD player', description: 'diam neque vestibulum eget vulputate', price: { value: 66.04, currency: 'CNY' }, status: 'Stocked on demand', statusColor: 'informative', date: new Date(), verified: true }; }); window.ITEMS_MAP = new Map(ITEMS_ARRAY.map((item, index) => [index, item])); window.initialIndex = Math.floor(Math.random() * 500); window.indexes = new Array(500).fill(null).map((item, index) => window.initialIndex + index);
Tests:
Accessing random index in array
window.indexes.forEach((index) => { const smt = window.ITEMS_ARRAY[index]; });
Accessing random index in map
window.indexes.forEach((index) => { const smt = window.ITEMS_MAP.get(index); });