Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0
Chrome 134
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
regex start 831.1 Ops/sec
startsWith 2201.0 Ops/sec
regex end 716.0 Ops/sec
endsWith 1718.7 Ops/sec
indexOf start 15833.4 Ops/sec
indexOf end 15806.0 Ops/sec
charAt end 1628.9 Ops/sec
charCodeAt end 1592.4 Ops/sec
charCodeAt start 2022.7 Ops/sec
substring 13158.6 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

  • substring