Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Firefox 131
Windows
Desktop
20 days ago
Test name Executions per second
regex start 193.6 Ops/sec
startsWith 300.5 Ops/sec
regex end 177.2 Ops/sec
endsWith 281.9 Ops/sec
indexOf start 4411.5 Ops/sec
indexOf end 4153.2 Ops/sec
charAt end 449.0 Ops/sec
charCodeAt end 492.2 Ops/sec
charCodeAt start 438.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