Saturday, March 15, 2014

String.Concat vs StringBuilder Performance

Everyone knows that Strings are immutable in .NET, thus the StringBuilder class is very important for saving memory when dealing with manipulating large strings.

...but what about performance?

Interestingly, StringBuilder is just an all around better way to combine strings! It is more memory efficient, and less processor intensive; but not by much. Below is a comparison of performance between different ways of combine strings.

No comments:

Post a Comment

Search This Blog

About Tom

Tom DuPont is a Software Engineer. He has been a tool at CodeSmith, made love at Match, and now makes war for Blizzard. He specializes in C#, ASP.NET, and even that crazy JavaScript stuff. His views and opinions are his own.

Listen to Tom

Tom is a host on the QQ Cast, where he helps answer geek culture's most superfluous questions.