Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Map vs Object (counter incl)
(version: 0)
Lookup of map vs object
Comparing performance of:
Map lookup vs Obj lookup
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var map = new Map(); var obj = {}; map.set('a', 5); obj['a'] = 5; var i = 0, count = 1000, a;
Tests:
Map lookup
for (i = 0; i < count; i++) { map.set(+map.get('a') + 1); }
Obj lookup
for (i = 0; i < count; i++) { obj['a'] += 1; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Map lookup
Obj lookup
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 from() vs Map.keys()
Array from() vs Map.keys() vs Map.values() vs spread
array includes vs object key lookup, large arrays
Map vs Object read performance for a 1000 key lookup
Map.forEach vs Array.forEach vs Array.from(Map.prototype.values()).forEach
Comments
Confirm delete:
Do you really want to delete benchmark?