Run details:
Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G977N) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/14.2 Chrome/87.0.4280.141 Mobile Safari/537.36
Chrome Mobile 87
Android
Mobile
3 years ago
Test name Executions per second
substring and substring 1492025.6 Ops/sec
replace inline regex 326071.1 Ops/sec
replace compiled regex var 322388.9 Ops/sec
brackets and substring 1653252.8 Ops/sec
brackets and slice 1678123.8 Ops/sec
substring and slice 1429248.2 Ops/sec
brackets and substr (legacy) 1670429.9 Ops/sec
substr and substr (legacy) 1437182.9 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)


;