Run details:
Mozilla/5.0 (Linux; Android 12; M2102J20SG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.5481.192 Mobile Safari/537.36 OPR/74.1.3922.71199
Opera Mobile 74
Android
Mobile
one year ago
Test name Executions per second
text.includes() 10255340.0 Ops/sec
regex.test() 6247741.0 Ops/sec
string.match() 5213705.0 Ops/sec
string.indexOf() 10285840.0 Ops/sec
string.indexOf() !== -1 10343000.0 Ops/sec
string.indexOf() != -1 10395950.0 Ops/sec
Script Preparation code:
Tests:
  • text.includes()

  • regex.test()

  • string.match()

  • string.indexOf()

  • string.indexOf() !== -1

  • string.indexOf() != -1