Script Preparation code:
Tests:

Historical Performance Data aggregated from 5 community runs

Desktop Results:
Chrome 5 runs
string slice
15K/s
string substring
10K/s
regex replace
9K/s

Fastest: string slice (1.7x faster)

View exact numbers
  • string slice: 14,793 ops/sec
  • string substring: 9,933 ops/sec
  • regex replace: 8,703 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
    regex replace
    string substring
    string slice

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120 on Windows
View result in a separate tab
string slice
14K/s
string substring
10K/s
regex replace
8K/s
View exact numbers
Test name Executions per second
string slice 14,445 Ops/sec
string substring 9,704 Ops/sec
regex replace 8,405 Ops/sec