Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124
Windows
Desktop
7 months ago
Test name Executions per second
regex start 380.9 Ops/sec
startsWith 713.9 Ops/sec
regex end 295.9 Ops/sec
endsWith 614.2 Ops/sec
indexOf start 6563.9 Ops/sec
indexOf end 7401.3 Ops/sec
charAt end 515.9 Ops/sec
charCodeAt end 574.3 Ops/sec
charCodeAt start 515.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • regex start

  • startsWith

  • regex end

  • endsWith

  • indexOf start

  • indexOf end

  • charAt end

  • charCodeAt end

  • charCodeAt start