Concatenation

JavaScript performance comparison

Test case created by Martin McCool

Info

Test of String optimisations

Preparation code

<script>
  var value = ",";
</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
Concatenation
var veryLongMessage = "This is a long message that is intended to" + "test the string concatentation performance losses " + "incurred through using " + " very long sentances  " + value + " in conjunction with variables.";
pending…
Join
var veryLongMessage = ["This is a long message that is intended to", "test the string concatentation performance losses ", "incurred through using ", " very long sentances  ", value, " in conjunction with variables."].join();
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:

1 comment

Erick Ribeiro commented :

https://developers.google.com/speed/articles/optimizing-javascript

false!!

Add a comment