Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109
Windows
Desktop
one year ago
Test name Executions per second
regex start 382.0 Ops/sec
startsWith 416.1 Ops/sec
regex end 359.5 Ops/sec
endsWith 425.3 Ops/sec
indexOf start 8066.1 Ops/sec
indexOf end 7633.8 Ops/sec
charAt end 358.4 Ops/sec
charCodeAt end 376.9 Ops/sec
charCodeAt start 363.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