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

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: 8 days 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() 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