Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:88.0) Gecko/20100101 Firefox/88.0
Firefox 88
Mac OS X 10.15
Desktop
3 years ago
Test name Executions per second
short endsWith 53669500.0 Ops/sec
short regexp 29880094.0 Ops/sec
short charAt 598558336.0 Ops/sec
short brackets 586225792.0 Ops/sec
short CharCodeAt 593618496.0 Ops/sec
short slice 33991800.0 Ops/sec
short substr 34452224.0 Ops/sec
short substring 32999896.0 Ops/sec
long endsWidth 57714504.0 Ops/sec
long regexp 30394388.0 Ops/sec
long charAt 654380800.0 Ops/sec
long brackets 622703616.0 Ops/sec
long charCodeAt 648815040.0 Ops/sec
long slice 35199440.0 Ops/sec
long substr 35425952.0 Ops/sec
long substring 34209812.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