Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Chrome 113
Windows
Desktop
one year ago
Test name Executions per second
arr 100 (includes) 18605004.0 Ops/sec
arr 100 (indexOf) 14607237.0 Ops/sec
set 100 18792146.0 Ops/sec
arr 10000 (includes) 15896852.0 Ops/sec
arr 10000 (indexOf) 953015.5 Ops/sec
set 10000 18690998.0 Ops/sec
arr 1000000 (includes) 8595633.0 Ops/sec
arr 1000000 (indexOf) 268455.2 Ops/sec
set 1000000 16378441.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