Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15
Safari 13
Mac OS X 10.15.4
Desktop
4 years ago
Test name Executions per second
substring and substring 2489172.5 Ops/sec
replace inline regex 3158774.2 Ops/sec
replace compiled regex var 2317639.2 Ops/sec
brackets and substring 2643561.0 Ops/sec
brackets and slice 2693499.0 Ops/sec
substring and slice 2571746.8 Ops/sec
brackets and substr (legacy) 2627356.8 Ops/sec
substr and substr (legacy) 2511304.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)


;