Script Preparation code:
AخA
 
var p = 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?';
Tests:
  • String.replaceAll

     
    p.replaceAll('dog', 'monkey');
  • split and join

     
    p.split('dog').join('monkey');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    String.replaceAll
    split and join

    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 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36
Chrome 88 on Mac OS X 11.1.0
View result in a separate tab
Test name Executions per second
String.replaceAll 255044.1 Ops/sec
split and join 893894.2 Ops/sec