Script Preparation code:
Tests:
  • regexp .test()

  • string .match()

  • indexOf === 0

  • string .startsWith()

  • regexp .test() failure

  • string .match() failure

  • indexOf === 0 failure

  • string .startsWith() failure

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    regexp .test()
    string .match()
    indexOf === 0
    string .startsWith()
    regexp .test() failure
    string .match() failure
    indexOf === 0 failure
    string .startsWith() failure

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 months ago)
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 on Mac OS X 10.15.7
View result in a separate tab
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