Run details:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:57.0) Gecko/20100101 Firefox/57.0
Firefox 57
Windows 7
Desktop
4 years ago
Test name Executions per second
substring and substring 13533438.0 Ops/sec
replace inline regex 9592837.0 Ops/sec
replace compiled regex var 9599001.0 Ops/sec
brackets and substring 22613328.0 Ops/sec
brackets and slice 31001520.0 Ops/sec
substring and slice 15546903.0 Ops/sec
brackets and substr (legacy) 33632500.0 Ops/sec
substr and substr (legacy) 11924260.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)


;