Test name | Executions per second |
---|---|
WeakMap set | 16791.4 Ops/sec |
Symbol Property set | 18412.7 Ops/sec |
WeakMap get | 16242.6 Ops/sec |
Symbol Property get | 18481.1 Ops/sec |
var to0 = {};
var to1 = {};
var wm = new WeakMap();
var sy = Symbol();
wm.set(to1, 1);
to1[sy] = 1;
for(let i=900;--i;) wm.set(to0, 1);
for(let i=900;--i;) to0[sy] = 1;
for(let i=900;--i;) {let r = wm.get(to1);}
for(let i=900;--i;) {let r = to1[sy];}