Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Get from object vs get from map
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Object
22328.3 Ops/sec
Map
2336.6 Ops/sec
Tests:
Object
let obj = {}; for (let i = 0; i < 10000; i++) { obj[i] = i; } let out = new Array(100); for (let t = 0; t < 100; t++) { const idx = Math.floor(Math.random() * 10000); out[t] = obj[idx] }
Map
let map = new Map(); for (let i = 0; i < 10000; i++) { map.set(i, i); } let out = new Array(100); for (let t = 0; t < 100; t++) { const idx = Math.floor(Math.random() * 10000); out[t] = map.get(idx) }