Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0
Firefox 95
Linux
Desktop
3 years ago
Test name Executions per second
regex start 399.7 Ops/sec
startsWith 388.5 Ops/sec
regex end 382.5 Ops/sec
endsWith 385.3 Ops/sec
indexOf start 317.3 Ops/sec
indexOf end 317.2 Ops/sec
charAt end 1708.8 Ops/sec
charCodeAt end 1695.8 Ops/sec
charCodeAt start 1691.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