Ad
  • Custom User Avatar

    In .NET 7 using Linq Sum is the best option. Great performance improvements were made.
    So I checked your code and my code and here's what I got

    Method Size Mean Error StdDev Allocated
    WithLinq 10000 8.716 us 0.1534 us 0.2521 us -
    SumArray 10000 18.587 us 0.1429 us 0.1336 us -