Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117
Windows
Desktop
one year ago
Test name Executions per second
regex start 309.1 Ops/sec
startsWith 624.2 Ops/sec
regex end 278.5 Ops/sec
endsWith 590.1 Ops/sec
indexOf start 6671.7 Ops/sec
indexOf end 5162.3 Ops/sec
charAt end 506.7 Ops/sec
charCodeAt end 572.1 Ops/sec
charCodeAt start 564.0 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