Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109
Windows
Desktop
4 months ago
Test name Executions per second
replace inline regex 270063.0 Ops/sec
replace compiled regex var 265422.8 Ops/sec
indexOf slice+1 2572478.5 Ops/sec
indexOf slice+1 and redundant replace 2240837.8 Ops/sec
split index 2412399.2 Ops/sec
Script Preparation code:
Tests:
  • replace inline regex

  • replace compiled regex var

  • indexOf slice+1

  • indexOf slice+1 and redundant replace

  • split index