Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome 87
Mac OS X 10.10.5
Desktop
one year ago
Test name Executions per second
regex start 358.8 Ops/sec
startsWith 423.5 Ops/sec
regex end 318.2 Ops/sec
endsWith 440.1 Ops/sec
indexOf start 5878.5 Ops/sec
indexOf end 5858.5 Ops/sec
charAt end 695.2 Ops/sec
charCodeAt end 706.7 Ops/sec
charCodeAt start 714.2 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