Tests:
  • Set

    x
     
    let set = new Set();
    for (let i = 10000; i < 11000; i++) {
      set.add(i);
    }
    for (let i = 10000; i < 11000; i++) {
      set.has(i);
    }
  • Obj

     
    let set = {};
    for (let i = 10000; i < 11000; i++) {
      set[i] = true;
    }
    for (let i = 10000; i < 11000; i++) {
      Object.prototype.hasOwnProperty.call(set, i);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Set
    Obj

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
Chrome 89 on Mac OS X 10.14.6
View result in a separate tab
Test name Executions per second
Set 27200.6 Ops/sec
Obj 2663.9 Ops/sec