Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0
Firefox 98
Windows
Desktop
2 years ago
Test name Executions per second
regex start 342.9 Ops/sec
startsWith 370.3 Ops/sec
regex end 322.2 Ops/sec
endsWith 370.2 Ops/sec
indexOf start 293.2 Ops/sec
indexOf end 291.5 Ops/sec
charAt end 1456.0 Ops/sec
charCodeAt end 1449.7 Ops/sec
charCodeAt start 1369.8 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