Test name | Executions per second |
---|---|
WeakMap set | 14126756.0 Ops/sec |
Symbol Property set | 14978403.0 Ops/sec |
WeakMap get | 7216884.5 Ops/sec |
Symbol Property get | 7425304.5 Ops/sec |
Symbol Property get (from own descriptor) | 4879848.0 Ops/sec |
Symbol Property get (if hasOwn) | 3861038.2 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(to1, sy) ? to1[sy] : undefined;