Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
regex.test 10477850.0 Ops/sec
string.match 5397100.0 Ops/sec
string.includes 10879656.0 Ops/sec
string.startsWith 7367980.5 Ops/sec
String.localeCompare 273542.6 Ops/sec
String === 10959138.0 Ops/sec
Script Preparation code:
Tests:
  • regex.test

  • string.match

  • string.includes

  • string.startsWith

  • String.localeCompare

  • String ===