Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0
Firefox 112
Linux
Desktop
one year ago
Test name Executions per second
regex start 321.1 Ops/sec
startsWith 449.9 Ops/sec
regex end 309.6 Ops/sec
endsWith 432.7 Ops/sec
indexOf start 6480.5 Ops/sec
indexOf end 7517.3 Ops/sec
charAt end 1178.3 Ops/sec
charCodeAt end 1012.8 Ops/sec
charCodeAt start 1093.1 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