4 ms·
I love LINQ (the object method syntax not the keyword syntax) and used it extensively in a production application in ~2015-2017. It is easier in many cases to w
by jasonthorsness 1y ago
I love LINQ (the object method syntax not the keyword syntax) and used it extensively in a production application in ~2015-2017. It is easier in many cases to write and read than manual loops.
In performance-critical code at the time it had to be avoided due to allocations and poor performance compared to loop-based implementations.
However, the new versions of .NET have been reducing this penalty [1], to the point where it might make sense to try LINQ first if it's more concise/clear then only rewrite after profiling!
[1] https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-10#linq https://devblogs.microsoft.com/dotnet/performance-improvemen...