Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Chrome 129
Windows
Desktop
2 months ago
Test name Executions per second
Regex loop 671070.8 Ops/sec
Regex 826892.4 Ops/sec
Original 611938.5 Ops/sec
Original reversed 559301.7 Ops/sec
LastIndexOf 1533721.2 Ops/sec
LastIndexOf B 1298930.8 Ops/sec
LastIndexOf 2 860388.6 Ops/sec
Script Preparation code:
Tests:
  • Regex loop

  • Regex

  • Original

  • Original reversed

  • LastIndexOf

  • LastIndexOf B

  • LastIndexOf 2