Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:98.0) Gecko/20100101 Firefox/98.0
Firefox 98
Mac OS X 10.15
Desktop
2 years ago
Test name Executions per second
regex start 304.6 Ops/sec
startsWith 372.4 Ops/sec
regex end 290.0 Ops/sec
endsWith 372.0 Ops/sec
indexOf start 291.7 Ops/sec
indexOf end 293.0 Ops/sec
charAt end 1171.7 Ops/sec
charCodeAt end 1112.5 Ops/sec
charCodeAt start 1171.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