Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.43
Chrome 114
Windows
Desktop
one year ago
Test name Executions per second
arr 100 (includes) 4034888.2 Ops/sec
arr 100 (indexOf) 4230588.5 Ops/sec
set 100 7462771.5 Ops/sec
arr 10000 (includes) 97429.2 Ops/sec
arr 10000 (indexOf) 115638.4 Ops/sec
set 10000 7244513.0 Ops/sec
arr 1000000 (includes) 89896.3 Ops/sec
arr 1000000 (indexOf) 106875.1 Ops/sec
set 1000000 7319527.0 Ops/sec
Script Preparation code:
Tests:
  • arr 100 (includes)

  • arr 100 (indexOf)

  • set 100

  • arr 10000 (includes)

  • arr 10000 (indexOf)

  • set 10000

  • arr 1000000 (includes)

  • arr 1000000 (indexOf)

  • set 1000000


;