Run details:
Mozilla/5.0 (iPad; CPU OS 14_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/176.0.394746740 Mobile/15E148 Safari/604.1
Mobile Safari 14
iOS 14.7
Tablet
2 years ago
Test name Executions per second
substring and substring 2296388.0 Ops/sec
replace inline regex 2812802.0 Ops/sec
replace compiled regex var 2246110.0 Ops/sec
brackets and substring 2428308.0 Ops/sec
brackets and slice 2452825.0 Ops/sec
substring and slice 2380676.0 Ops/sec
brackets and substr (legacy) 2422574.0 Ops/sec
substr and substr (legacy) 2327312.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)