Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.1 Mobile/15E148 Safari/604.1
Mobile Safari 16
iOS 16.5.1
Mobile
10 months ago
Test name Executions per second
substring and substring 7037503.0 Ops/sec
replace inline regex 7384019.0 Ops/sec
replace compiled regex var 6224850.0 Ops/sec
brackets and substring 7099129.0 Ops/sec
brackets and slice 7050946.0 Ops/sec
substring and slice 6839729.0 Ops/sec
brackets and substr (legacy) 6677129.0 Ops/sec
substr and substr (legacy) 6221209.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)