string concat vs array join (v65)

Revision 65 of this benchmark created by Test on


Setup

var words = ['this', 'is', 'a', 'test'];
  
  var text = words[0];
  
  var a = new Array(10000);
  a[0] = words[0];
  
  var i;
  
  var text2;

Test runner

Ready to run.

Testing in
TestOps/sec
Concat
console.log("this" + "is" + "a" + "sentence" + "this" + "is" + "a" + "sentence" + "this" + "is" + "a" + "sentence" + "this" + "is" + "a" + "sentence" + "this" + "is" + "a" + "sentence" + "this" + "is" + "a" + "sentence" + "this" + "is" + "a" + "sentence" + "this" + "is" + "a" + "sentence" + "this" + "is" + "a" + "sentence" + "this" + "is" + "a" + "sentence");
ready
Join
console.log(["this", "is", "a", "sentence", "this", "is", "a", "sentence", "this", "is", "a", "sentence" ,"this", "is", "a", "sentence" ,"this", "is", "a", "sentence", "this", "is", "a", "sentence", "this", "is", "a", "sentence", "this", "is", "a", "sentence" ,"this", "is", "a", "sentence" ,"this", "is", "a", "sentence"].join(""));
ready

Revisions

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