Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36
Chrome 70
Mac OS X 10.14.1
Desktop
6 years ago
Test name Executions per second
slice [1K char range] 9511197.0 Ops/sec
substr [1K char range] 9111663.0 Ops/sec
substring [1K char range] 7571763.0 Ops/sec
slice [10 char range] 7025721.5 Ops/sec
substr [10 char range] 7870234.5 Ops/sec
substring [10 char range] 7302561.0 Ops/sec
Script Preparation code:
Tests:
  • slice [1K char range]

  • substr [1K char range]

  • substring [1K char range]

  • slice [10 char range]

  • substr [10 char range]

  • substring [10 char range]