Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Windows
Desktop
7 months ago
Test name Executions per second
regex start 714.0 Ops/sec
startsWith 1191.1 Ops/sec
regex end 649.2 Ops/sec
endsWith 1132.4 Ops/sec
indexOf start 14049.0 Ops/sec
indexOf end 14291.3 Ops/sec
charAt end 968.6 Ops/sec
charCodeAt end 1038.7 Ops/sec
charCodeAt start 1048.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