Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.0.0 Safari/537.36
Chrome 91
Windows
Desktop
3 years ago
Test name Executions per second
short endsWith 9466460.0 Ops/sec
short regexp 4825882.5 Ops/sec
short charAt 5522023.0 Ops/sec
short brackets 5547052.0 Ops/sec
short CharCodeAt 5548566.0 Ops/sec
short slice 11287434.0 Ops/sec
short substr 11312745.0 Ops/sec
short substring 5676787.5 Ops/sec
long endsWidth 9434316.0 Ops/sec
long regexp 4860472.5 Ops/sec
long charAt 5559106.0 Ops/sec
long brackets 5551017.5 Ops/sec
long charCodeAt 5556339.5 Ops/sec
long slice 11394167.0 Ops/sec
long substr 11330452.0 Ops/sec
long substring 5658648.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