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() 20737790.0 Ops/sec
string .match() 11782940.0 Ops/sec
indexOf === 0 1115799000.0 Ops/sec
string .startsWith() 1095399000.0 Ops/sec
Script Preparation code:
Tests:
  • regexp .test()

  • string .match()

  • indexOf === 0

  • string .startsWith()