Taking globalization into account when displaying strings to the user means that they are properly formatted for their language and locale. This article shows the performance for string.Format(). Updated February 2023.
Category: Coding Standards
Serializing Objects Performance: XML Serialization
XML serialization has been around ever since .NET was released since it was so widely used back then. It’s still widely used, especially for legacy applications and services, even iTunes still uses XML to store library information. Benchmark results are for .NET 6 & 7.
Performance: Expanded & Expression Bodied Methods
A newer way of creating simple methods in .NET is by using expression-bodied methods. This article shows which method is more performant.
String Performance: Encoding and Decoding Strings
Encoding and decoding strings to and from a byte[] is used a lot in programming. Performance results are for using the formatting options ASCII, Unicode, UTF8, and UTF32, Latin and BigEndianUnicode. Updated February 2023
String Performance: Combining Strings with the StringBuilder
In programming, efficient string concatenation is crucial. Utilizing the StringBuilder class, especially within loops, offers better performance and reduced memory usage. Methods like AppendFormat() and AppendLine() provide formatting and localization benefits. Benchmark results show StringBuilder's significant speed advantage, with minimal memory allocations. Consistently using StringBuilder for string concatenation is recommended.
String Performance: Formatting
This article discusses the performance differences using string.Format() and interpolation and stresses the importance of using globalization with any string shown to the user. Updated January 2023.
Collection Performance: A Comprehensive Benchmark Analysis of Collection Types in .NET Beyond Arrays and Lists
This article conducts a comprehensive benchmark analysis of various collection types in .NET beyond arrays and lists. It explores the performance of iteration methods, revealing significant differences among types, providing valuable insights for developers to choose the most performant collection type based on their code requirements.
Collection Performance: Adding Items to a Collection
The most popular way to add an item to a collection is by using Add(). The other way is by using Insert() or Prepend(). This article shows performance results for these three methods.
Collection Performance: Looping Over Reference Type vs. Value Type
Since most of the types and collections I create are typically business objects, I wondered if collections of simpler types would be faster. I decided to benchmark the difference between a List (reference type) with a List (value type).
Collection Performance: Sorting the Record Type
This article shows the difference between sorting a normal class type with a record class type.

You must be logged in to post a comment.