Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Get data from map in Map, Object and map in WeakMap
(version: 3)
Comparing performance of:
Object vs Map vs Map in WeakMap
Created:
one year ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
let o, m, w; const map = new Map(); const obj = Object.create(null); const wm = new WeakMap(); let data = Object.create(null); wm.set(data, new Map()); for (let i = 65; i < 90; i++) { let t = String.fromCharCode(i); obj[t] = i; map.set(t, i); wm.set(data, (wm.get(data)).set(t, i)); }
Tests:
Object
o = obj['M'];
Map
m = map.get('M');
Map in WeakMap
w = wm.get(data).get('M');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Object
Map
Map in WeakMap
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!
Comments
Confirm delete:
Do you really want to delete benchmark?