Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
short endsWith 10728230.0 Ops/sec
short regexp 5168257.5 Ops/sec
short charAt 6016233.0 Ops/sec
short brackets 6068339.0 Ops/sec
short CharCodeAt 6948587.5 Ops/sec
short slice 11279383.0 Ops/sec
short substr 11591580.0 Ops/sec
short substring 5683681.5 Ops/sec
long endsWidth 10625112.0 Ops/sec
long regexp 5361100.0 Ops/sec
long charAt 6438410.5 Ops/sec
long brackets 6749972.5 Ops/sec
long charCodeAt 6710199.5 Ops/sec
long slice 12311986.0 Ops/sec
long substr 12470320.0 Ops/sec
long substring 6558480.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