Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Map vs Object UUID Key/Value
(version: 0)
Lookup of map vs object
Comparing performance of:
Map vs Obj
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var uuid = crypto.randomUUID(); var i = 0, count = 500, a; a = crypto.randomUUID();
Tests:
Map
var map = new Map(); map.set(uuid, a); for (i = 0; i < count; i++) { map.set(a, crypto.randomUUID()); a = map.get(a); }
Obj
var obj = {}; obj[uuid] = a; for (i = 0; i < count; i++) { obj[a] = crypto.randomUUID(); a = obj[a]; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Map
Obj
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
7 months ago
)
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36
Browser/OS:
Chrome Mobile 140 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Map
2054.4 Ops/sec
Obj
1606.1 Ops/sec
Related benchmarks:
Math.random vs crypto.getRandomValues vs uuid
set.has vs. array.includes - 1000 UUIDs
lodash uniqueId vs crypto.randomUUID
Set string vs number
Comments
Confirm delete:
Do you really want to delete benchmark?