Run details:
Mozilla/5.0 (Linux; Android 11; motorola one hyper) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.5735.196 Mobile Safari/537.36 OPR/76.2.4027.73374
Opera Mobile 76
Android
Mobile
9 months ago
Test name Executions per second
substring and substring 1484877.0 Ops/sec
replace inline regex 1744284.0 Ops/sec
replace compiled regex var 1373704.0 Ops/sec
brackets and substring 1493044.0 Ops/sec
brackets and slice 1488261.0 Ops/sec
substring and slice 1502689.0 Ops/sec
brackets and substr (legacy) 1477142.0 Ops/sec
substr and substr (legacy) 1477328.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)