Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
Chrome 81
Mac OS X 10.14.5
Desktop
4 years ago
Test name Executions per second
substring and substring 2411360.2 Ops/sec
replace inline regex 2024121.4 Ops/sec
replace compiled regex var 1359146.0 Ops/sec
brackets and substring 1388070.0 Ops/sec
brackets and slice 1395868.2 Ops/sec
substring and slice 1414969.9 Ops/sec
brackets and substr (legacy) 1400355.6 Ops/sec
substr and substr (legacy) 1446584.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)


;