Script Preparation code:
Tests:
  • Array.includes, 10 000 elements

  • Array.includes, 1 000 000 elements

  • Set.has, 10 000 elements

  • Set.has, 1 000 000 elements

  • Array to Set + Set.has, 10 000 elements

  • Array to Set + Set.has x 100, 10 000 elements

  • Array.includes x 100, 10 000 elements

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Array.includes, 10 000 elements
    Array.includes, 1 000 000 elements
    Set.has, 10 000 elements
    Set.has, 1 000 000 elements
    Array to Set + Set.has, 10 000 elements
    Array to Set + Set.has x 100, 10 000 elements
    Array.includes x 100, 10 000 elements

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 hours ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Chrome 128 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Array.includes, 10 000 elements 104244.0 Ops/sec
Array.includes, 1 000 000 elements 1023.8 Ops/sec
Set.has, 10 000 elements 4587632.0 Ops/sec
Set.has, 1 000 000 elements 2012660.2 Ops/sec
Array to Set + Set.has, 10 000 elements 2651.8 Ops/sec
Array to Set + Set.has x 100, 10 000 elements 2577.3 Ops/sec
Array.includes x 100, 10 000 elements 1042.2 Ops/sec


;