Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130
Mac OS X 10.15.7
Desktop
one month ago
Test name Executions per second
Array.includes, 10 000 elements 105410.1 Ops/sec
Array.includes, 1 000 000 elements 806.4 Ops/sec
Set.has, 10 000 elements 4736543.0 Ops/sec
Set.has, 1 000 000 elements 1436983.9 Ops/sec
Array to Set + Set.has, 10 000 elements 3692.1 Ops/sec
Array to Set + Set.has x 100, 10 000 elements 3534.5 Ops/sec
Array.includes x 100, 10 000 elements 1051.2 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