Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36
Chrome 89
Mac OS X 11.2.3
Desktop
3 years ago
Test name Executions per second
substring and substring 2967344.5 Ops/sec
replace inline regex 590734.9 Ops/sec
replace compiled regex var 561840.2 Ops/sec
brackets and substring 2679157.0 Ops/sec
brackets and slice 2780340.8 Ops/sec
substring and slice 2777767.2 Ops/sec
brackets and substr (legacy) 2796032.8 Ops/sec
substr and substr (legacy) 2739730.2 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)


;