Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/91.0.4472.80 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 91
iOS 14.6
Mobile
2 years ago
Test name Executions per second
substring and substring 4362583.0 Ops/sec
replace inline regex 5193269.0 Ops/sec
replace compiled regex var 4085422.0 Ops/sec
brackets and substring 4916345.0 Ops/sec
brackets and slice 5042538.0 Ops/sec
substring and slice 4509011.0 Ops/sec
brackets and substr (legacy) 4708652.0 Ops/sec
substr and substr (legacy) 4264201.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)