Test name | Executions per second |
---|---|
WeakMap set | 12726717.0 Ops/sec |
Symbol Property set | 13497805.0 Ops/sec |
WeakMap get | 6409639.0 Ops/sec |
Symbol Property get | 6529689.0 Ops/sec |
Symbol Property get (from own descriptor) | 4280086.0 Ops/sec |
Symbol Property get (if hasOwn) | 3817115.0 Ops/sec |
var to0 = {};
var to1 = {};
var wm = new WeakMap();
var sy = Symbol();
wm.set(to1, 1);
to1[sy] = 1;
window.r = 0
wm.set(to0, 1);
to0[sy] = 1;
r = wm.get(to1);
r = to1[sy];
r = Object.getOwnPropertyDescriptor(to1, sy).value;
r = Object.hasOwn(sy) ? to1[sy] : undefined;