Run details:
Mozilla/5.0 (iPad; CPU OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/84.0.4147.71 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 84
iOS 13.5
Tablet
3 years ago
Test name Executions per second
substring and substring 2113684.0 Ops/sec
replace inline regex 2614808.0 Ops/sec
replace compiled regex var 2055397.0 Ops/sec
brackets and substring 2237691.0 Ops/sec
brackets and slice 2265482.0 Ops/sec
substring and slice 2173114.0 Ops/sec
brackets and substr (legacy) 2215696.0 Ops/sec
substr and substr (legacy) 2129403.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)