Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
My Map vs Object Insert
(version: 0)
Comparing performance of:
Map Get vs Object Get
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; var map = new Map(); var obj = {}; var i = 0, j = 0, count = 10000, ch, a; for (j = 0; j < 10; j++) { map.set(characters[j], "qwertyuiop"); } for (j = 0; j < 10; j++) { obj[characters[j]] = "qwertyuiop"; }
Tests:
Map Get
for (i = 0; i < count; i++) { ch = Math.floor(Math.random() * 10) a = map.get(ch); }
Object Get
for (i = 0; i < count; i++) { ch = Math.floor(Math.random() * 10) a = obj[ch]; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Map Get
Object Get
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:
Object vs Map
Map vs ImmutableJs copy
Create Object vs Map vs Array vs Set
Array from() vs Map.keys()
comparing Map and object
Comments
Confirm delete:
Do you really want to delete benchmark?