Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0
Firefox 129
Windows
Desktop
one month ago
Test name Executions per second
regex start 923.4 Ops/sec
startsWith 1396.4 Ops/sec
regex end 871.6 Ops/sec
endsWith 1423.9 Ops/sec
indexOf start 15331.2 Ops/sec
indexOf end 22758.5 Ops/sec
charAt end 2172.8 Ops/sec
charCodeAt end 2090.2 Ops/sec
charCodeAt start 2113.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