Run details:
Mozilla/5.0 (Linux; Android 10; SAMSUNG SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/13.0 Chrome/83.0.4103.106 Mobile Safari/537.36
Chrome Mobile 83
Android
Mobile
3 years ago
Test name Executions per second
substring and substring 1745569.5 Ops/sec
replace inline regex 1980441.8 Ops/sec
replace compiled regex var 1510767.4 Ops/sec
brackets and substring 1715366.2 Ops/sec
brackets and slice 1732773.5 Ops/sec
substring and slice 1784643.8 Ops/sec
brackets and substr (legacy) 1687606.5 Ops/sec
substr and substr (legacy) 1590978.6 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)


;