Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/111.0
Firefox 111
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
regex start 313.0 Ops/sec
startsWith 549.3 Ops/sec
regex end 289.5 Ops/sec
endsWith 542.2 Ops/sec
indexOf start 5560.8 Ops/sec
indexOf end 9507.7 Ops/sec
charAt end 1065.7 Ops/sec
charCodeAt end 1022.8 Ops/sec
charCodeAt start 983.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