Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0
Firefox 133
Windows
Desktop
23 days ago
Test name Executions per second
Array.includes, 10 000 elements 36673.3 Ops/sec
Array.includes, 1 000 000 elements 297.4 Ops/sec
Set.has, 10 000 elements 27727520.0 Ops/sec
Set.has, 1 000 000 elements 24228318.0 Ops/sec
Array to Set + Set.has, 10 000 elements 635.4 Ops/sec
Array to Set + Set.has x 100, 10 000 elements 614.8 Ops/sec
Array.includes x 100, 10 000 elements 378.4 Ops/sec
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