Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
Chrome 126
Windows
Desktop
3 months ago
Test name Executions per second
regex start 51.2 Ops/sec
startsWith 145.8 Ops/sec
regex end 45.0 Ops/sec
endsWith 114.9 Ops/sec
indexOf start 87.6 Ops/sec
indexOf end 68.5 Ops/sec
charAt end 57.8 Ops/sec
charCodeAt end 61.5 Ops/sec
charCodeAt start 70.5 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