Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36
Chrome 93
Linux
Desktop
3 years ago
Test name Executions per second
regex start 353.9 Ops/sec
startsWith 445.4 Ops/sec
regex end 308.3 Ops/sec
endsWith 429.4 Ops/sec
indexOf start 5901.8 Ops/sec
indexOf end 5966.6 Ops/sec
charAt end 694.5 Ops/sec
charCodeAt end 698.5 Ops/sec
charCodeAt start 641.9 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