Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0
Firefox 106
Linux
Desktop
2 years ago
Test name Executions per second
regexp .test() 22465384.0 Ops/sec
string .match() 12349942.0 Ops/sec
indexOf === 0 1100756480.0 Ops/sec
string .startsWith() 1104240512.0 Ops/sec
Script Preparation code:
Tests:
  • regexp .test()

  • string .match()

  • indexOf === 0

  • string .startsWith()