Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
Chrome 90
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
short endsWith 13604411.0 Ops/sec
short regexp 7043301.5 Ops/sec
short charAt 8287638.5 Ops/sec
short brackets 8288572.0 Ops/sec
short CharCodeAt 8331884.0 Ops/sec
short slice 14135657.0 Ops/sec
short substr 14228337.0 Ops/sec
short substring 7807244.5 Ops/sec
long endsWidth 13658647.0 Ops/sec
long regexp 7062987.0 Ops/sec
long charAt 8182522.5 Ops/sec
long brackets 8298561.0 Ops/sec
long charCodeAt 8219625.0 Ops/sec
long slice 14056206.0 Ops/sec
long substr 12059657.0 Ops/sec
long substring 6977349.5 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


;