Run details:
Mozilla/5.0 (Linux; Android 9; Unspecified Device) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.0.0 Mobile Safari/537.36
Chrome Mobile 90
Android
Mobile
3 years ago
Test name Executions per second
regexp .test() 2241096.8 Ops/sec
string .match() 1880323.8 Ops/sec
indexOf === 0 3324388.2 Ops/sec
string .startsWith() 2484945.8 Ops/sec
Script Preparation code:
Tests:
  • regexp .test()

  • string .match()

  • indexOf === 0

  • string .startsWith()