Run details:
Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
Firefox 86
Windows 8.1
Desktop
3 years ago
Test name Executions per second
substring 5628491.0 Ops/sec
replace inline regex 2321569.2 Ops/sec
replace compiled regex var 1717914.2 Ops/sec
slice 5496519.5 Ops/sec
brackets and substr (legacy) 5631971.0 Ops/sec
Script Preparation code:
Tests:
  • substring

  • replace inline regex

  • replace compiled regex var

  • slice

  • brackets and substr (legacy)