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) 4564109.0 Ops/sec
String.match(RegExp) 3687145.5 Ops/sec
String.indexOf() 6121560.0 Ops/sec
String.startsWith() 5091746.5 Ops/sec
Script Preparation code:
Tests:
  • RegExp.test(String)

  • String.match(RegExp)

  • String.indexOf()

  • String.startsWith()