#549 – March 23, 2025
Examples, Internals and Performance Benchmarks
Object Pools in C#: Examples, Internals and Performance Benchmarks
8 minutes by Alexey Fedorov
In this guide Alexey explains how Object Pool is implemented in C# through ObjectPool and ArrayPool classes. He examines how these pools work internally and presents benchmark results showing that while object pooling typically improves performance in single-threaded scenarios by 10-50%, it may perform worse in multithreaded scenarios with small objects due to thread synchronization overhead.
WeAreDevelopers World Congress 2025 – July 9-11, Berlin
sponsored by WeAreDevelopers
The world's leading event for developers is back. Join 15,000+ developers and 500+ experts as they explore everything from AI and Cybersecurity to Cloud, DevOps, and Web Development. Gain insights into modern .NET development, performance optimization, and cloud-native applications with top speakers from Microsoft, GitHub, and many more. Use code "WWC25_C5DIGEST" for 5% off your ticket.
.NET Heisenbug Mystery Theater: How Did an Exception Escape its Catch Block?
10 minutes by Aaron Stannard
Aaron describes a complex bug in the Akka.NET system related to the SelectAsync stage. Due to non-atomic assignment of struct values, a race condition occurred when a Result struct was being written on one thread while being read on another, resulting in null Exception values escaping catch blocks. The issue manifested as mysterious ArgumentException errors claiming "Cancellation cause must not be null." The fix involved simplifying the code by ensuring all struct operations happened on the same thread through AsyncCallback rather than adding complex synchronization mechanisms.
The key new features in .NET 10
7 minutes by Simon Bisson
In this post Simon presents the first preview of .NET 10, a long-term support release building on the current .NET version with focus on performance and reliability. Key improvements include runtime optimizations that reduce abstraction overhead for arrays, support for upcoming processor architecture features like AVX 10.2, enhancements to ASP.NET Core and Blazor, upgraded OpenAPI support, and developer productivity features such as better string sorting with numerals.
RESTful API Best Practices for .NET Developers
13 minutes by Mukesh Murugan
I’ve put together this guide to help .NET developers like you understand REST principles and build better APIs. Whether you’re just starting out or looking to refine your skills, this article covers RESTful architecture, best practices, and how to implement them in ASP.NET Core. Let’s dive in and make your API development journey smoother and more efficient.
New HybridCache in .NET9
11 minutes by Marek Sirkovský
Marek dives deep into A New Two-Level Caching Solution for .NET HybridCache that is Microsoft's new caching library for .NET 9 that introduces a two-level caching mechanism using IMemoryCache and optional IDistributedCache. While it offers valuable features like cache stampede prevention and performance optimizations, it has limitations including a restricted API surface, dependency on abstract classes instead of interfaces, and fewer advanced features compared to third-party solutions like FusionCache or CacheTower.
And the most popular article from the last issue was: