Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Dict vs. Map
Large dictionary - how worse is it from array with direct reference? And how does Map perform?
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Dictionary
184324.2 Ops/sec
Map
186131.7 Ops/sec
Script Preparation code:
var dict= {} for (var i=0; i<50000; i++) { dict['abc_'+i] = i; } var map= new Map() for (var i=0; i<50000; i++) { map.set('abc_'+i, i); }
Tests:
Dictionary
let c = 0 for (i=2000; i<10000; i+=115) { c += dict['abc_'+i]}
Map
let c = 0 for (i=2000; i<10000; i+=115) { c += map.get('abc_'+i)}