| Test |
String.Concat() |
StringBuilder |
| 1000x10 char strings |
4 ms |
9 ms |
| 1000x50 char strings |
20 ms |
10 ms |
| 1000x500 char strings |
1852 ms |
100 ms |
Table 1
Time is of the Essence. Using String.Builder for a few Append operations often is sluggish compared to String.Concat(), but it's faster for strings created in loops. Here are the times for String.Concat() and StringBuilder.
|