Script Preparation code:
Tests:
  • Replace

  • Replace All

  • Split+Join

  • Replace from var

  • Replace all from var

  • Split+join from var

  • Replace with template literal

  • Split+join with template literal

  • Replace with regex

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Replace
    Replace All
    Split+Join
    Replace from var
    Replace all from var
    Split+join from var
    Replace with template literal
    Split+join with template literal
    Replace with regex

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.53
Chrome 105 on Windows
View result in a separate tab
Test name Executions per second
Replace 2022509.0 Ops/sec
Replace All 2196861.0 Ops/sec
Split+Join 1940000.0 Ops/sec
Replace from var 1888056.0 Ops/sec
Replace all from var 1802844.0 Ops/sec
Split+join from var 1588001.0 Ops/sec
Replace with template literal 1872054.0 Ops/sec
Split+join with template literal 1583513.0 Ops/sec
Replace with regex 2001473.0 Ops/sec