This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String concatenation

 
Eric Pascarello
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic