string build

Benchmark created on


Setup

var data = [];
for (var i = 0; i < 10000; i++) {
  var output = ''
  for (var j = 1; j < 17; j++) {
	let item = Math.floor(Math.random() * 26) + 65;
	output += String.fromCharCode(item);
  }
  data.push(output);
}

Test runner

Ready to run.

Testing in
TestOps/sec
array push
let output = [];
for (var item in data) {
	output.push(item);
	output.push('\n');
}
output = output.join('');
ready
string concat
let output = '';
for (var item in data) {
	output += item + '\n';
}
ready

Revisions

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