Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36
Chrome 87
Mac OS X 11.0.1
Desktop
3 years ago
Test name Executions per second
substring and substring 4318772.0 Ops/sec
replace inline regex 4465935.5 Ops/sec
replace compiled regex var 3610019.2 Ops/sec
brackets and substring 4447777.5 Ops/sec
brackets and slice 4466168.5 Ops/sec
substring and slice 4462580.5 Ops/sec
brackets and substr (legacy) 4438376.0 Ops/sec
substr and substr (legacy) 4443553.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)


;