Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122
Mac OS X 10.15.7
Desktop
7 months ago
Test name Executions per second
short endsWith 26933452.0 Ops/sec
short regexp 11955802.0 Ops/sec
short charAt 14229462.0 Ops/sec
short brackets 14256519.0 Ops/sec
short CharCodeAt 14883711.0 Ops/sec
short slice 24639356.0 Ops/sec
short substr 24456252.0 Ops/sec
short substring 13945622.0 Ops/sec
long endsWidth 26683430.0 Ops/sec
long regexp 11770068.0 Ops/sec
long charAt 13890839.0 Ops/sec
long brackets 13685679.0 Ops/sec
long charCodeAt 14480058.0 Ops/sec
long slice 24437054.0 Ops/sec
long substr 23919680.0 Ops/sec
long substring 13677162.0 Ops/sec
Script Preparation code:
Tests:
  • short endsWith

  • short regexp

  • short charAt

  • short brackets

  • short CharCodeAt

  • short slice

  • short substr

  • short substring

  • long endsWidth

  • long regexp

  • long charAt

  • long brackets

  • long charCodeAt

  • long slice

  • long substr

  • long substring