In this post, I will introduce and demonstrate enhancements to collections in .NET 9 and C# 13 for low-allocation code paths. Specifically, I will demonstrate using a custom IAlternateEqualityComparer and the AlternateLookup on a Dictionary used for efficiently tracking IP address information, keyed on the bytes of IP addresses. My use case, the basis for […]
Tag: performance
.NET Performance Optimisations Don’t Have to be Complex
Readers who have followed me for some time will know that I have developed a bit of a passion for performance improvements and avoiding allocations in critical code paths. Previous blog posts have touched on examples of using Span<T> as one mechanism to prevent allocations when parsing data and using ArrayPool to avoid array allocations […]
Analysing the Large Object Heap in JetBrains dotMemory Writing High-Performance C# and .NET Code: Part 7
In my last post, which is part of my ‘Writing High-Performance C# and .NET Code‘ series, we looked at how we can begin interpreting some of the data from a dotMemory profiling session. In this post, we’ll continue the analysis by investigating why we saw that the Large Object Heap (LOH) size grows for about […]