What problem does it solve?
It addresses the hidden performance costs in LINQ queries such as unnecessary client‑side evaluation, repeated query enumeration, and allocation‑heavy LINQ‑to‑Objects patterns that degrade .NET application responsiveness.
Core Features & Use Cases
- IQueryable vs IEnumerable guidance: Detects server‑side vs client‑side evaluation and advises proper materialization.
- Compiled query support: Shows how to create and use EF Core compiled queries for high‑frequency lookups.
- Deferred execution safeguards: Highlights multiple enumeration pitfalls and provides patterns to materialize results safely.
- Allocation‑aware LINQ‑to‑Objects: Identifies iterator and delegate allocations, offering manual loop alternatives.
- Span‑based zero‑allocation alternatives: Presents when to replace LINQ with
Span<T>/ReadOnlySpan<T> for critical paths.
- Query optimization patterns: Includes projection before materialization, keyset pagination, and batch update techniques.
Quick Start
Use the dotnet-linq-optimization skill to analyze a LINQ query and get optimization recommendations.