Performance Tips: Faster than StringBuilder?

The web has tons of articles about how StringBuilder is much faster than string concatenation using ‘+’ operator or String.Concat functions when there are enough strings to ber merged. Here is an MSDN article on this topic: http://support.microsoft.com/kb/306822 But actually, if all you want is concatenating strings, there is a more efficient way of doing…

7

Performance Tips: System.Text.StringBuilder and String.Concat

Much has been written about the benefits of using StringBuilder over string concatenation. So much so that there seems to be overuse of StringBuilder class, causing performance issues again. If you’re using StringBuilder and string concatenation a lot in your program, here are a few more things to ponder: String.Concat(str1, str2) is a perfect string…

2

Performance Tips: String.Split

String.Split methods are provided in .Net as a convenient way of dividing string into parts. Here are two basic forms of String.Split methods: public string[] Split(char[] separator, int count, StringSplitOptions options); public string[] Split(string[] separator, int count, StringSplitOptions options); Also String.Split methods are quite easy to use, there are hidde performance issues you should be…

0

TextWriter.WriteLine(string, object[]) in less memory, less time

I found myself increasingly generating reports in .csv format, and then use Excel to analyze the reports. With large amount of data written to the .csv file, file generation time becomes more and more noticable. So I took some time to check what is taking so much time and how can it be reduced. For…

1