Run details:
Mozilla/5.0 (Android 4.2.2; Tablet; rv:68.0) Gecko/68.0 Firefox/68.0
Android 4
Android 4.2.2
Tablet
2 years ago
Test name Executions per second
substring and substring 1531074.0 Ops/sec
replace inline regex 557543.6 Ops/sec
replace compiled regex var 1492139.0 Ops/sec
brackets and substring 2638114.0 Ops/sec
brackets and slice 2866511.0 Ops/sec
substring and slice 1665208.0 Ops/sec
brackets and substr (legacy) 2710556.0 Ops/sec
substr and substr (legacy) 1724826.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)