Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Mobile Safari/537.36
Chrome Mobile 128
Android
Mobile
3 months ago
Test name Executions per second
Array.includes, 10 000 elements 66034.4 Ops/sec
Array.includes, 1 000 000 elements 636.4 Ops/sec
Set.has, 10 000 elements 1987089.6 Ops/sec
Set.has, 1 000 000 elements 679303.9 Ops/sec
Array to Set + Set.has, 10 000 elements 1713.3 Ops/sec
Array to Set + Set.has x 100, 10 000 elements 1669.1 Ops/sec
Array.includes x 100, 10 000 elements 664.0 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