Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128
Mac OS X 10.15
Desktop
5 months ago
Test name Executions per second
regexp .test() 63493420.0 Ops/sec
string .match() 33598588.0 Ops/sec
indexOf === 0 1587551488.0 Ops/sec
string .startsWith() 1607082112.0 Ops/sec
Script Preparation code:
Tests:
  • regexp .test()

  • string .match()

  • indexOf === 0

  • string .startsWith()