Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0
Firefox 99
Ubuntu
Desktop
2 years ago
Test name Executions per second
regex start 248.3 Ops/sec
startsWith 214.1 Ops/sec
regex end 244.5 Ops/sec
endsWith 216.7 Ops/sec
indexOf start 184.7 Ops/sec
indexOf end 183.2 Ops/sec
charAt end 986.0 Ops/sec
charCodeAt end 983.9 Ops/sec
charCodeAt start 1002.5 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