Script Preparation code:
AخA
 
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];
  • WeakMap has

     
    let r = wm.has(to1);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    WeakMap set
    Symbol Property set
    WeakMap get
    Symbol Property get
    WeakMap has

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Linux; Android 12; M2101K9G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Mobile Safari/537.36
Chrome Mobile 107 on Android
View result in a separate tab
Test name Executions per second
WeakMap set 2677249.5 Ops/sec
Symbol Property set 2861349.0 Ops/sec
WeakMap get 2725366.5 Ops/sec
Symbol Property get 2871802.5 Ops/sec
WeakMap has 2597251.8 Ops/sec