Performance comparaison of string concatenation strategies

Recently, I’ve had a conversation with Davide Bellone, on LinkedIn about the different strategies of string concatenation and their relative performance (You can read its post here). His take was that, even though the built-in class StringBuilder is generally the most performant way to concatenate string, it isn’t always the best choice, especially with fewer items. To prove his point, he showed the benchmark he ran with the associated code :...

January 1, 2024 · 3 min