array join / string concat (v3)

Revision 3 of this benchmark created on


Setup

var letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
    
    function gs() {
      var length = ((Math.random() * 15) + 5).toFixed(),
          output = "";
    
      for (var i = 0; i < length; i++) {
        output += letters[(Math.random() * 26).toFixed(0)];
      }
    
      return output;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
array join
var test = [gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs(), gs()].join('');
ready
string concat with random input
var test = gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs() + gs();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.