.NET 10 array ennumeration performance improvements (JIT array de-abstraction)
| |

.NET 10: Array ennumeration performance improvements (JIT array de-abstraction)

In .NET 10 Preview 1, the JIT compiler got better at optimizing how arrays are used with interfaces, especially when looping through them using foreach. This was the first step toward reducing the extra cost that comes with using enumerators to go through arrays. Preview 2 builds on this work with even more improvements. Take…

ToArray performance in .NET 9 compared to .NET 8
| | |

.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 to significantly reduce memory allocations and improve speed, especially when dealing with an IEnumerable<T> of unknown length. If you’re curious about the implementation,…