Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0
Chrome 123
Mac OS X 10.15.7
Desktop
20 days ago
Test name Executions per second
regexp .test() 17450190.0 Ops/sec
string .match() 14155650.0 Ops/sec
indexOf === 0 26731630.0 Ops/sec
string .startsWith() 19714600.0 Ops/sec
regexp .test() failure 17556490.0 Ops/sec
string .match() failure 14471780.0 Ops/sec
indexOf === 0 failure 26399540.0 Ops/sec
string .startsWith() failure 19662740.0 Ops/sec
Script Preparation code:
Tests:
  • regexp .test()

  • string .match()

  • indexOf === 0

  • string .startsWith()

  • regexp .test() failure

  • string .match() failure

  • indexOf === 0 failure

  • string .startsWith() failure