Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Chrome 102
Windows 7
Desktop
one year ago
Test name Executions per second
RegExp.test(String) 4581830.0 Ops/sec
String.match(RegExp) 3811810.5 Ops/sec
String.indexOf() 6481333.0 Ops/sec
String.startsWith() 5263199.5 Ops/sec
Script Preparation code:
Tests:
  • RegExp.test(String)

  • String.match(RegExp)

  • String.indexOf()

  • String.startsWith()