Run details:
Mozilla/5.0 (Linux; Android 11; moto g fast) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.74 Mobile Safari/537.36
Chrome Mobile 95
Android
Mobile
2 years ago
Test name Executions per second
substring and substring 976323.5 Ops/sec
replace inline regex 1106108.0 Ops/sec
replace compiled regex var 865284.1 Ops/sec
brackets and substring 966331.8 Ops/sec
brackets and slice 978031.8 Ops/sec
substring and slice 983600.3 Ops/sec
brackets and substr (legacy) 980593.5 Ops/sec
substr and substr (legacy) 984134.3 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)