Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36 EdgA/131.0.0.0
Chrome Mobile 131
Android
Mobile
one month ago
Test name Executions per second
Array.includes, 10 000 elements 50414.6 Ops/sec
Array.includes, 1 000 000 elements 477.8 Ops/sec
Set.has, 10 000 elements 1976633.9 Ops/sec
Set.has, 1 000 000 elements 878232.7 Ops/sec
Array to Set + Set.has, 10 000 elements 1379.6 Ops/sec
Array to Set + Set.has x 100, 10 000 elements 1321.9 Ops/sec
Array.includes x 100, 10 000 elements 489.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