Script Preparation code:
AخA
 
var str = '/3123/213/123/412/41/4';
Tests:
  • Regex

     
    str.replace(/\//g, "$&Z");
  • Split and Join

     
    str.split('/').join('/Z');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Regex
    Split and Join

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0
Firefox 132 on Windows
View result in a separate tab
Test name Executions per second
Regex 1341738.1 Ops/sec
Split and Join 4351575.5 Ops/sec