Script Preparation code:
AخA
 
var str = 'this is it';
Tests:
  • regex

     
    str.replace(/./g, "$&Z");
  • split+join

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

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    regex
    split+join

    Fastest: N/A

    Slowest: N/A

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/115.0.0.0 Safari/537.36
Chrome 115 on Windows
View result in a separate tab
Test name Executions per second
regex 1192963.2 Ops/sec
split+join 2040878.9 Ops/sec