bazbaz wrote:
My tests reported 40% better performance with this patter instead of string concatenation.
|
It really depends on what you are doing with the StringBuilder. In one small app processing a small file, I sped it up by over 200x by changing to StringBuilder.
In another instance, the stringbuilder could do it, but string concatenation simply could not do it at all, at least before my patience ran out. There I was working with strings a few MB in size.
I know that if I were using larger files, the speed difference would be larger. So obviously we aren't dealing with a strictly static performance improvement. It would be nice to know the equation that would tell us exactly what the performance improvement 'curve' is.