← Back
Nick Chapsas August 26, 2024 9m

When LINQ Makes You Write Worse .NET Code

Summary

The main theme discusses the misuse of LINQ's `Last()` method in performance-critical scenarios, particularly in benchmarks. It critiques how some benchmarks incorrectly measure LINQ's `Last()` and `ElementAt()` by not ensuring the return value is used, leading to the operations being optimized away. The practical takeaway is to write accurate benchmarks that avoid these pitfalls and to use LINQ judiciously, opting for more explicit solutions when performance is paramount.

View original episode ↗