Test name | Executions per second |
---|---|
WeakMap set | 14262492.0 Ops/sec |
Symbol Property set | 14462870.0 Ops/sec |
WeakMap get | 7349803.5 Ops/sec |
Symbol Property get | 7678899.0 Ops/sec |
Symbol Property get (from own descriptor) | 5070251.5 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;