Run details:
Mozilla/5.0 (Linux; Android 9; Unspecified Device) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.0.0 Mobile Safari/537.36
Chrome Mobile 83
Android
Mobile
3 years ago
Test name Executions per second
substring and substring 1167428.0 Ops/sec
replace inline regex 1318364.0 Ops/sec
replace compiled regex var 1020222.0 Ops/sec
brackets and substring 1157094.0 Ops/sec
brackets and slice 1108812.0 Ops/sec
substring and slice 1202527.0 Ops/sec
brackets and substr (legacy) 1118305.0 Ops/sec
substr and substr (legacy) 1123221.0 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)