20
C# Array and List Fastest Loop in 2024 - NDepend Blog
(blog.ndepend.com)
A community about the C# programming language
Getting started
Useful resources
IDEs and code editors
Tools
Rules
Related communities
I actually benchmarked almost exactly these same things, a few months ago, and that lines up with the results I got.
foreachin particular is HEAVILY optimized forArray<T>at the bytecode level, I was quite impressed.