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 1802719.2 Ops/sec
replace inline regex 1990451.5 Ops/sec
replace compiled regex var 1791489.9 Ops/sec
brackets and substring 2029718.0 Ops/sec
brackets and slice 2441709.0 Ops/sec
substring and slice 1113363.4 Ops/sec
brackets and substr (legacy) 2064857.0 Ops/sec
substr and substr (legacy) 2643530.8 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)


;