Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130
Windows
Desktop
2 days ago
Test name Executions per second
Array.includes, 10 000 elements 57511.7 Ops/sec
Array.includes, 1 000 000 elements 607.9 Ops/sec
Set.has, 10 000 elements 2532546.8 Ops/sec
Set.has, 1 000 000 elements 1082573.1 Ops/sec
Array to Set + Set.has, 10 000 elements 2063.7 Ops/sec
Array to Set + Set.has x 100, 10 000 elements 1933.8 Ops/sec
Array.includes x 100, 10 000 elements 698.3 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


;