Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
Chrome 101
Linux
Desktop
2 years ago
Test name Executions per second
regex start 498.7 Ops/sec
startsWith 615.4 Ops/sec
regex end 463.1 Ops/sec
endsWith 625.0 Ops/sec
indexOf start 9059.8 Ops/sec
indexOf end 8936.3 Ops/sec
charAt end 905.2 Ops/sec
charCodeAt end 892.2 Ops/sec
charCodeAt start 816.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