Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
Chrome 115
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
short endsWith 12199373.0 Ops/sec
short regexp 6255905.0 Ops/sec
short charAt 7056004.5 Ops/sec
short brackets 7068964.5 Ops/sec
short CharCodeAt 7393103.5 Ops/sec
short slice 13957643.0 Ops/sec
short substr 13695306.0 Ops/sec
short substring 7109135.0 Ops/sec
long endsWidth 11948836.0 Ops/sec
long regexp 6163526.0 Ops/sec
long charAt 6989870.5 Ops/sec
long brackets 6977847.0 Ops/sec
long charCodeAt 7247603.0 Ops/sec
long slice 13995096.0 Ops/sec
long substr 13888733.0 Ops/sec
long substring 7375635.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