The fifth edition of David McCarter's book, "Röck Yöur Cöde: Code & App Performance for Microsoft .NET," is now available on Amazon. It offers practical techniques for enhancing .NET application performance, including coding patterns, memory insights, and benchmarking. This definitive guide is essential for modern .NET developers aiming for speed and scalability.
Category: .NET Core
Rock Your Code: Coding Standards for Microsoft .NET (20th Anniversary Edition)
The 20th Anniversary Edition of Rock Your Code: Coding Standards for Microsoft .NET, authored by David McCarter, is now available on Amazon. This comprehensive guide offers updated standards for .NET 10, best practices, and expert insights, making it essential for software engineers aiming for improved code quality and performance over two decades.
Optimizing Base64 String Conversion to Byte Array in Microsoft .NET
This article discusses converting Base64-encoded strings to byte arrays in .NET using two methods. The fastest method is backed up by benchmark tests.
Comparing Type Checking Methods in .NET: Performance vs. Readability
In .NET, type checking methods include GetType(), the is keyword, IsAssignableFrom(), and the as keyword. Each method varies in readability and performance.
Boosting Loop Performance in .NET: The Simple Trick of Caching Array Length
The post discusses optimizing array iteration in programming by caching the array's length for performance improvements. This method yields a 1.021x performance boost, particularly beneficial for loops executed frequently. The author encourages this technique and recommends their book for more insights on enhancing .NET code performance.
Collection Performance: Introducing FrozenSet in .NET 8: Benefits and Benchmark PerformanceCollection Performance
.NET version 8 introduced the FrozenSet type, offering immutable and hashable set collection with benefits including improved performance, memory efficiency, and thread safety. Benchmarks show comparable performance to List, outperforming HashSet and ImmutableHashSet. However, it is slightly slower than the latter in lookups. FrozenSet offers significant advantages for concurrent applications and memory optimization.
Collection Performance: Enhancing Dictionary Performance with FrozenDictionary
The FrozenDictionary is a thread-safe, immutable, read-only dictionary optimized for fast lookups. It outperforms the Dictionary, reducing iteration and lookup times significantly.
Serializing Objects: Efficient Serialization and Deserialization of Collections with JsonSerializer
The article demonstrates the ease of serializing and deserializing collections using JsonSerializer.
Optimizing Collection Examination: A Comparative Analysis of Predicate Methods in C#
The article explores four methods for examining items in a collection using predicates, with a focus on performance. A Twitter poll revealed that over 50% of developers favored the LINQ Any() method, prompting the author to verify its efficiency in comparison to other options like Count() and Exists().
Code It Any Way You Want: Initializing Reference Type Static Fields Inline for Enhanced Code Readability
The article advocates for initializing reference type static fields inline to enhance code readability and prevent unexpected behavior caused by uninitialized static fields. Microsoft recommends initializing these fields at the point of declaration to improve clarity. The article provides examples demonstrating the issue and the recommended solution, emphasizing the use of static constructors for initialization.

You must be logged in to post a comment.