Script Preparation code:
AخA
 
var nLoops = 1000;
Tests:
  • Same string added each loop

    x
     
    var fragmentToAdd = Math.random();
    var str = '';
    for (var i = 0; i < nLoops; i++) {
      // Just to equalize the work done in each test
      var randomString = String(Math.random());
      str += fragmentToAdd; 
    }
  • Different string added each loop

     
    var str = '';
    for (var i = 0; i < nLoops; i++) {
      var randomString = String(Math.random());
      str += randomString;
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Same string added each loop
    Different string added each loop

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0
Firefox 109 on Mac OS X 10.15
View result in a separate tab
Test name Executions per second
Same string added each loop 355105.4 Ops/sec
Different string added each loop 9863.4 Ops/sec