cover

Optimizing dynamic collections with predictive sizing

Dynamic collections, such as the dynamic array (also known as a List in C#), are without a doubt one of the most common data structure, and not only in C# but in computer science in general. The dotnet base class library exposes plenty of dynamic collections to fulfil a wide number of usecases: (System.Collections.)List<T>, Dictionary<K, V>, HashSet<T>, Queue<T>, Stack<T>, and more. But they all share one thing in common: they are based on dynamic reallocation of backing arrays, which can lead to suboptimal performance and excessive memory allocation....

cover

Challenges & memory considerations for in-memory caching

In this article I’d like to share my journey learning about caching, and my research on how to make it more efficient. This article is the first in a serie of articles about caching, and here we’ll start by discussing the challenges and memory considerations when doing in-memory caching. This was done as part of my day job as a Staff backend engineer at Equativ, a leading provider of digital advertising solutions, offering a range of products and services to help businesses reach their target audiences and achieve their marketing goals....