Tests:
  • twostep

    AخA
     
    const str = "https://firebasestorage.googleapis.com/v0/b/a-sketch-a-day-207420.appspot.com/o/things.jpg?alt=media&token=alan"
    str.replace(
          "https://firebasestorage.googleapis.com/v0/b/a-sketch-a-day-207420.appspot.com/o/",
          "https://images.sketchaday.app/",
        )
        .replace(/\?.*/, "")
  • regex

     
    const str = "https://firebasestorage.googleapis.com/v0/b/a-sketch-a-day-207420.appspot.com/o/things.jpg?alt=media&token=alan"
    str.replace(/https:\/\/firebasestorage.googleapis.com\/v0\/b\/a-sketch-a-day-207420.appspot.com\/o\/(.*)\?.*/, "https://images.sketchaday.app/$1")
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    twostep
    regex

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36
Chrome 84 on Mac OS X 10.15.5
View result in a separate tab
Test name Executions per second
twostep 1627245.2 Ops/sec
regex 1394658.9 Ops/sec