Run details:
Mozilla/5.0 (Linux; Android 12; Pixel 3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36
Chrome Mobile 100
Android
Mobile
2 years ago
Test name Executions per second
substring and substring 1663655.0 Ops/sec
replace inline regex 1868808.0 Ops/sec
replace compiled regex var 1468764.0 Ops/sec
brackets and substring 1756236.0 Ops/sec
brackets and slice 1723708.0 Ops/sec
substring and slice 1679857.0 Ops/sec
brackets and substr (legacy) 1758502.0 Ops/sec
substr and substr (legacy) 1743574.0 Ops/sec
Script Preparation code:
Tests:
  • substring and substring

  • replace inline regex

  • replace compiled regex var

  • brackets and substring

  • brackets and slice

  • substring and slice

  • brackets and substr (legacy)

  • substr and substr (legacy)