Script Preparation code:
Tests:

Historical Performance Data aggregated from 8 community runs

Desktop Results:
Chrome 8 runs
substring
206.5M/s
slice
199.4M/s
substr
183.9M/s

Fastest: substring (1.1x faster)

View exact numbers
  • substring: 206,490,064 ops/sec
  • slice: 199,388,688 ops/sec
  • substr: 183,945,120 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    slice
    substring
    substr

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:153.0) Gecko/20100101 Firefox/153.0
Firefox 153 on Windows
View result in a separate tab
substring
1803.8M/s
slice
1682.5M/s
substr
1596.5M/s
View exact numbers
Test name Executions per second
substring 1,803,795,584 Ops/sec
slice 1,682,530,944 Ops/sec
substr 1,596,457,344 Ops/sec