Run details:
Mozilla/5.0 (Linux; Android 10; moto e(7) plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.61 Mobile Safari/537.36
Chrome Mobile 101
Android
Mobile
2 years ago
Test name Executions per second
substring and substring 816494.7 Ops/sec
replace inline regex 890460.0 Ops/sec
replace compiled regex var 717793.7 Ops/sec
brackets and substring 803921.8 Ops/sec
brackets and slice 816524.1 Ops/sec
substring and slice 833885.7 Ops/sec
brackets and substr (legacy) 756100.7 Ops/sec
substr and substr (legacy) 721889.2 Ops/sec
Script Preparation code:
Tests:
  • substring and substring

  • replace inline regex

  • replace compiled regex var

  • brackets and substring

  • brackets and slice

  • substring and slice

  • brackets and substr (legacy)

  • substr and substr (legacy)