Run details:
Mozilla/5.0 (Linux; Android 8.0.0; SAMSUNG-SM-G935A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Mobile Safari/537.36
Chrome Mobile 87
Android 8.0.0
Mobile
3 years ago
Test name Executions per second
substring and substring 950000.8 Ops/sec
replace inline regex 946127.3 Ops/sec
replace compiled regex var 795475.7 Ops/sec
brackets and substring 678999.7 Ops/sec
brackets and slice 658795.9 Ops/sec
substring and slice 581915.8 Ops/sec
brackets and substr (legacy) 585497.6 Ops/sec
substr and substr (legacy) 595934.8 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)