Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Firefox 122
Windows
Desktop
9 months ago
Test name Executions per second
regex start 949.9 Ops/sec
startsWith 686.4 Ops/sec
regex end 818.2 Ops/sec
endsWith 665.6 Ops/sec
indexOf start 20390.1 Ops/sec
indexOf end 20305.3 Ops/sec
charAt end 1879.4 Ops/sec
charCodeAt end 1888.3 Ops/sec
charCodeAt start 1834.7 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