• 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: 64832
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic