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
7 months ago
Test name Executions per second
regexp .test() 17450186.0 Ops/sec
string .match() 14155647.0 Ops/sec
indexOf === 0 26731626.0 Ops/sec
string .startsWith() 19714600.0 Ops/sec
regexp .test() failure 17556494.0 Ops/sec
string .match() failure 14471784.0 Ops/sec
indexOf === 0 failure 26399540.0 Ops/sec
string .startsWith() failure 19662736.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


;