Script Preparation code:
x
 
var a = [];
var b = {}
for (var i = 0; i < 1000000; i++) {
    a.push(i);
    b[i] = `${i}`;
}
var set = new Set([...a]);
Tests:
  • SET

     
    set.has(14500)
  • Obect

     
    b[14500]
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    SET
    Obect

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Chrome 118 on Windows
View result in a separate tab
Test name Executions per second
SET 10802026.0 Ops/sec
Obect 11886358.0 Ops/sec