Script Preparation code:
Tests:

Historical Performance Data aggregated from 1,052 community runs

Desktop Results:
Chrome 831 runs
slice
26.3M/s
substr
26.2M/s
substring
26.0M/s
View exact numbers
  • slice: 26,316,470 ops/sec
  • substr: 26,185,510 ops/sec
  • substring: 26,009,332 ops/sec
Firefox 127 runs
slice
767.7M/s
substring
745.0M/s
substr
741.6M/s
View exact numbers
  • slice: 767,651,456 ops/sec
  • substring: 745,024,960 ops/sec
  • substr: 741,618,368 ops/sec
Safari 54 runs
substring
30.0M/s
slice
30.0M/s
substr
22.6M/s

Fastest: substring (1.3x faster)

View exact numbers
  • substring: 30,005,708 ops/sec
  • slice: 29,958,860 ops/sec
  • substr: 22,615,116 ops/sec
Other 17 runs
substr
14.0M/s
substring
13.9M/s
slice
13.8M/s
View exact numbers
  • substr: 14,039,904 ops/sec
  • substring: 13,925,229 ops/sec
  • slice: 13,753,495 ops/sec
Mobile Results:
Chrome 23 runs
slice
14.0M/s
substring
13.3M/s
substr
11.8M/s

Fastest: slice (1.2x faster)

View exact numbers
  • slice: 13,999,319 ops/sec
  • substring: 13,348,020 ops/sec
  • substr: 11,827,959 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
    substr
    substring

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Chrome 149 on Mac OS X 10.15.7
View result in a separate tab
slice
333.8M/s
substring
329.2M/s
substr
327.4M/s
View exact numbers
Test name Executions per second
slice 333,794,432 Ops/sec
substring 329,150,592 Ops/sec
substr 327,376,416 Ops/sec