Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 YaBrowser/21.6.1.7 (beta) Yowser/2.5 Safari/537.36
Yandex Browser 21
Mac OS X 10.15.6
Desktop
3 years ago
Test name Executions per second
substring and substring 3111145.8 Ops/sec
replace inline regex 3250130.8 Ops/sec
replace compiled regex var 2507137.5 Ops/sec
brackets and substring 2968462.8 Ops/sec
brackets and slice 2953564.8 Ops/sec
substring and slice 2955914.0 Ops/sec
brackets and substr (legacy) 3083696.8 Ops/sec
substr and substr (legacy) 2945591.5 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)


;