Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36
Chrome 73
Windows 7
Desktop
4 years ago
Test name Executions per second
substring and substring 2163812.5 Ops/sec
replace inline regex 2680834.8 Ops/sec
replace compiled regex var 2197374.2 Ops/sec
brackets and substring 2329781.8 Ops/sec
brackets and slice 2364875.8 Ops/sec
substring and slice 2401939.2 Ops/sec
brackets and substr (legacy) 2411612.8 Ops/sec
substr and substr (legacy) 2315858.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)


;