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
6 months ago
Test name Executions per second
regex start 537.1 Ops/sec
startsWith 1000.0 Ops/sec
regex end 500.9 Ops/sec
endsWith 973.9 Ops/sec
indexOf start 12859.8 Ops/sec
indexOf end 12466.3 Ops/sec
charAt end 929.3 Ops/sec
charCodeAt end 905.8 Ops/sec
charCodeAt start 934.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