Tests:
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Via Array methods
    String.replace()
    String.slice()
    String.substring()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.2 Safari/605.1.15
Safari 26 on Mac OS X 10.15.7
View result in a separate tab
String.slice()
329.1M/s
String.substring()
312.9M/s
String.replace()
308.0M/s
Via Array methods
7.6M/s
View exact numbers
Test name Executions per second
String.slice() 329,138,656 Ops/sec
String.substring() 312,920,704 Ops/sec
String.replace() 308,000,480 Ops/sec
Via Array methods 7,613,029 Ops/sec