• Post Reply Bookmark Topic Watch Topic
  • New Topic

String concatenation  RSS feed

 
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is know that building strings with += is bad practice since it is slow and we should be using Arrays with join.

Does anyone know where the performance gain begins. [Like the StringBuilder in C# sees gains starting around 10 concats]

I plan on running some tests later on today. I was hoping someone had some insight.

Eric
 
Author and ninkuma
Marshal
Posts: 66729
167
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never done any tests myself. I figure with everything else that is going on, any performance difference would just be noise unless you are talking on the scale of hundreds or thousands.
 
You showed up just in time for the waffles! And this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!