100 strings, 100 chars each

JavaScript performance comparison

Revision 31 of this test case created

Info

Different ways to concatenate strings together

Preparation code

<script>
  var arr = ['RPKGQAREWXKVCSLNRTQKFRTXMIFQKHOCWYINZARVXCQZUCNMVDWBVQZHYEYJMNLIMUVLVNHSPXSKAGWVJTXEJWMIBLRNYDVKYRWT','EDMUBEEBKBXUUUZERMNSXFFWIBHGSDAWGMRIQWJBXGWSBVWSIKLFPRBYSJEKMFHTRZBHVKJSRGKTBHMJRXPHORFHAKRNPZGGYIOT','TXMKDXEFEQPWOFDCWJJXTBKIBROAZCUTAGEEDIKIYAFMFJPCSZZLBKUCCICCLXVLDZQHHAQGAWTGFIIYIIKJTELVMOXXLSJPSAXZ','AOGBKZIQHQPPZZZSDLNQZLOLEXBWXZVYOBAZBIQIZFYYEYQIJEYJQMUUKWQHWMGKOGJPPZYOFXMJVDRFIPOYCJTMFKUCWANLHXBW','WZKCXXLTADYJTMIVVBHBLCDICQUJNVGKVQNSNYLOCKYVWGRRIZTUBXDEOXNCSUNNKAGYZSNBCLXYSOQAOKVPHYTVVHXOBKCMLIKK','BYLDKICCXSDLCYBKWVGSCDGEOJQZRBKTAVWKEYMCRPNUOPEKKKDNOKRDTIDLKNEKJAUNZHQQWELLTQWDBZRQJITCRXOBKSLUTFHS','NXJJBVVVLRZMQQCAYWDQTRREJCYDIGWVEFFGBABMRAZIRCJPYMFSDXWNZVQIBNEFTJLUKNHCOGLFIUVHGBZKYVXYROGSBKYVUKPF','XWHLCSRLMMSTNRDLNBJEQQXSBVNWFCBDYIPBBGMOSFHFXKRLMBQCRNUTJIPOKRRJAGKBNXQFCXKAICLUDBXVOSPXAFMKWETWLEYY','CODFMOFURQPURMQGEFEEKQPHVJEGOCFQRJVDXAXORMJJZAQDFUIQLYXGHBNVETLVCHYZIWOZIYIIYYMETUUESSLAUZVYSHUUOSUW','PJWXHFGGDSKXMECFXOFRNBQGIKBXDWTSFPQNUWTYPDWCIYHGMNYAPOGXZIUDEOWKENXYKRXZVT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NMBXEKSUFTBZNTCOSPJSOAFAYJANBNA','OABLFLEZQXAQLTTZMIIEWJKXITXWULXJLYVQKZPBXQRJKKJWSSBOCLLKFJHZUEJFDFWNFMODCFMMPVIINKWPVIAASIAMNKSQPODU','BSXDXJPNFYVTJSIEBJFTRGFEQXVGMYANQYROIHBNGXGPPPTQZZKRGPWWNRDAQEOHCFVLMXZSUGIKVCBVBLMHAIEOZHPPLDWOJSZW','PZPKFXUAZWVAHIIIQNWQUMFGPCVYVVULUJWZGRAGNWHUEPCVDZLYMREBUAAPWVBQFXQMOQSCNZWSPZNSZYQLPVNJWNZSIBIOYZAN','QSPDSMWHLJALHQXXMKHIXHBGIKVHJVUZNKDFWZNIJNTREQOQBWZZEBFMLBUUWOUKYYPVYDDHQXYUONLPKLOOMUBYVVSRKNBJMREK','UISLGRGUFSKPEYERTGPPBIGMVIVIAASVILGPCNKIFUYJTCBMJQBLYIXURSCRSVNBHTRKHBSMVQWOTXBCODNNLLHDDKUWGIYNCPXJ','QPWMGTBZRCCFFQSRBAUFKPBQXAEZQCJHSFTYYUYPXBVDRNUSOPXYFZPCATCQVLXNRRMPLKFJLAMDOHWCXTBCTQETKHKGTHUKYGZK']</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Direct concatenation
var foo = 'a' + 'b' + 'c' + 'd';
pending…
Individual += statements
var foo = 'a';
foo += 'b';
foo += 'c';
foo += 'd';
pending…
Individual statements
var foo = 'a';
foo = foo + 'b';
foo = foo + 'c';
foo = foo + 'd';
pending…
Using Array#join
var foo = arr.join('');
pending…
Single individual statement
var foo = 'a';
foo += 'b' + 'c' + 'd';
pending…
Function based (for)
function concat(arr) {
  len = arr.length;
  for (s = "", i = 0; i < len; s += arr[i], i++);
  return s;
}

var foo = concat(arr);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment