Tests:
  • regex

    AخA
     
    "this is it".replace(/ /g, "+");
  • replaceAll

     
    "this is it".replaceAll(" ", "+");
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    regex
    replaceAll

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 16 days ago)
Mozilla/5.0 (X11; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0
Firefox 136 on Linux
View result in a separate tab
Test name Executions per second
regex 3873528.5 Ops/sec
replaceAll 9211249.0 Ops/sec