Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Mobile/15E148 Safari/604.1
Mobile Safari 18
iOS 18.3.1
Mobile
one year ago
Test name Executions per second
regex start 865.1 Ops/sec
startsWith 793.8 Ops/sec
regex end 533.7 Ops/sec
endsWith 808.4 Ops/sec
indexOf start 6004.0 Ops/sec
indexOf end 519.8 Ops/sec
charAt end 1102.4 Ops/sec
charCodeAt end 1638.8 Ops/sec
charCodeAt start 1687.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