Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0
Firefox 105
Ubuntu
Desktop
2 years ago
Test name Executions per second
regex start 249.8 Ops/sec
startsWith 429.3 Ops/sec
regex end 192.1 Ops/sec
endsWith 250.9 Ops/sec
indexOf start 5222.9 Ops/sec
indexOf end 9020.3 Ops/sec
charAt end 863.2 Ops/sec
charCodeAt end 980.2 Ops/sec
charCodeAt start 881.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