General Performance: Handling Exceptions

In my presentation at the Silicon Valley Code Camp, a question about the performance of using the when() clause for catching exceptions prompted me to conduct performance testing.

Collection Performance: Comparing ImmutableArray<>’s with SequenceEqual()

The ImmutableArrayExtensions contain a SequenceEqual() method for comparing ImmutableArray items. The method compares elements using the default equality comparer for TSource and can be used with a for() loop for performance validation.

General Performance Tip: Comparing ComputeHash(), HashData(), and TryHashData() Methods

Developers can simplify hashing byte arrays by using HashData() instead of ComputeHash(), as it requires less code and eliminates the need to manage the SHA256 object. Benchmarking shows HashData() is about 1.16x faster than ComputeHash() and 1.02x faster than TryHashData(). EditorConfig helps manage related diagnostics.

General Performance Tip: Creating an Object

The author explores various object creation methods in .NET, highlighting performance differences. While the conventional "new" keyword proves to be the most efficient, other approaches like Activator.CreateInstance and RuntimeHelpers.GetUninitializedObject are also discussed.

Speed up Logging with Spargine FastLogger

FastLogger from DotNetTips.Spargine.Core offers efficient logging capabilities, significantly outperforming traditional methods by 11.14 times. Its easy implementation allows developers to quickly capture exceptions, achieving overall performance improvements exceeding five times. The tool's efficiency stems from integrating source generators into the code, enhancing logging processes.

Unveiling Spargine 8: A Comprehensive Guide to .NET 8 Integration and Exciting Feature Updates

The article announces the release of Spargine 8, a .NET 8 integrated version with updated NuGet packages. The comprehensive guide highlights new features, including a method for real-time file copying progress, additional functionalities in core, extensions, and tester libraries, along with significant transformations and breaking modifications, urging users to transition to the enhanced version for improved performance.

dotNetDave Rocks Warsaw IT Days 2024

I'm excited to announce that, for the first time ever, the For Those About To Code: World Wide Tour will be making a virtual stop at the 2024 Warsaw IT Days event in Warsaw, Poland, taking place from April 5th to 6th!

General Performance: Avoid Unnecessary Variable Initialization

The content warns against unnecessary variable initialization in code, which can complicate refactoring and increase execution costs, especially in loops. It emphasizes that default values for types like integers and objects don’t need explicit initialization unless an alternative state is desired. Necessary cases for initialization are also highlighted.

Coding Standards: Mastering Tuples in .NET

In .NET, tuples are immutable data structures that group multiple values of different types, simplifying code by avoiding custom classes. They are useful for returning or passing multiple values. Named tuples enhance readability but should not be overused. Accessing tuple elements can be done by position or via deconstruction.

String Performance: Comparing Strings with Globalization

In the String Performance chapter of the code performance book, the author demonstrates the usage of string.Compare() with StringComparison. Benchmark results are provided, along with a recommendation to use cultures or ordinals based on the strings being compared. The chapter also touches on setting up EditorConfig for dotnet_diagnostic.CA1862.