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() 22465380.0 Ops/sec
string .match() 12349940.0 Ops/sec
indexOf === 0 1100756000.0 Ops/sec
string .startsWith() 1104241000.0 Ops/sec
Script Preparation code:
Tests:
  • regexp .test()

  • string .match()

  • indexOf === 0

  • string .startsWith()