Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Chrome 92
Windows 7
Desktop
3 years ago
Test name Executions per second
includes from start 1824809.0 Ops/sec
includes true 1972566.8 Ops/sec
includes false 1171733.5 Ops/sec
indexOf true 2147013.0 Ops/sec
indexOf false 2270191.5 Ops/sec
indexOf nonexistent 2248367.8 Ops/sec
slice includes true 1855203.4 Ops/sec
slice includes false 1144800.8 Ops/sec
substring includes true 1871224.0 Ops/sec
substring includes false 1165118.4 Ops/sec
substring indexOf true 2258418.2 Ops/sec
substring indexOf false 2229017.0 Ops/sec
Script Preparation code:
Tests:
  • includes from start

  • includes true

  • includes false

  • indexOf true

  • indexOf false

  • indexOf nonexistent

  • slice includes true

  • slice includes false

  • substring includes true

  • substring includes false

  • substring indexOf true

  • substring indexOf false