Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.1 Mobile/15E148 Safari/604.1
Mobile Safari 26
iOS 18.7
Mobile
7 months ago
Test name Executions per second
regexp .test() 385790304.0 Ops/sec
string .match() 158040832.0 Ops/sec
indexOf === 0 881082112.0 Ops/sec
string .startsWith() 83451432.0 Ops/sec
Equality 80944496.0 Ops/sec
Script Preparation code:
Tests:
  • regexp .test()

  • string .match()

  • indexOf === 0

  • string .startsWith()

  • Equality