Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Map vs Object forkkk
(version: 1)
Lookup of map vs object
Comparing performance of:
Map lookup vs Obj lookup
Created:
one year ago
by:
Guest
Go to the latest result
Script Preparation code:
var map = new Map(); var obj = {}; map.set('a', 5); obj['a'] = 5; var i = 0, count = 5, a;
Tests:
Map lookup
for (i = 0; i < count; i++) { a = map.get('a'); }
Obj lookup
for (i = 0; i < count; i++) { a = obj['a']; }
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:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser/OS:
Chrome 131 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Obj lookup
1.8M/s
Map lookup
1.8M/s
View exact numbers
Test name
Executions per second
✓
Obj lookup
1,809,645 Ops/sec
Map lookup
1,752,754 Ops/sec
Related benchmarks
Map vs Object
Map vs Object - Lookup and write
Map vs Object 10 iterations
Comments
Confirm delete:
Do you really want to delete benchmark?