.NET Performance: ToList vs ToArray
.NET 9 brings significant improvements to LINQ’s ToArray method, both in terms of speed, as well as memory allocation. To achieve this, the new implementation makes use of new runtime features such as InlineArray and ArrayPool to significantly reduce memory allocations and improve speed, especially when dealing with an IEnumerable<T> of unknown length. If you’re curious about…