DotnetStringConcatBenchmark
Program.cs
This program measures productivity of concatenation of 10000 strings performed by different methods:
- Plus operator (PlusOperatorConcatTest)
- String.Join with entering capacity (FixedListConcatTest)
- String.Join without entering capacity (UnfixedListConcatTest)
- StringBuilder with entering capacity (FixedStringBuilderTest)
- StringBuilder without entering capacity (UnfixedStringBuilderTest)
Result:
Program2.cs
This program measures productivity of concatenation of small number of strings
- Plus operator (PlusOperatorConcatTest)
- String with dollar (DollarSign)
- String.Format (StringFormat)
- StringBuilder per each iteration (StringBuilder)
- StringBuilder pooling (ClearableStringBuilder)
Result: