Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
WeakMap vs Symbol Property
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Linux
Device Platform:
Desktop
Date tested:
7 months ago
Symbol Property get
1301.5M/s
Symbol Property set
1213.5M/s
WeakMap get
57.2M/s
WeakMap set
33.5M/s
View exact numbers
Test name
Executions per second
✓
Symbol Property get
1,301,498,496 Ops/sec
Symbol Property set
1,213,532,288 Ops/sec
WeakMap get
57,221,420 Ops/sec
WeakMap set
33,450,292 Ops/sec
Script Preparation code:
var to0 = {}; var to1 = {}; var wm = new WeakMap(); var sy = Symbol(); wm.set(to1, 1); to1[sy] = 1;
Tests:
WeakMap set
wm.set(to0, 1);
Symbol Property set
to0[sy] = 1;
WeakMap get
let r = wm.get(to1);
Symbol Property get
let r = to1[sy];