Why EF Core Performance Matters
ORM overhead is real. These three techniques address the most common bottlenecks in enterprise .NET apps.
1. AsNoTracking
var posts = await db.BlogPosts
.AsNoTracking()
.Where(p => p.Status == PostStatus.Published)
.ToListAsync();
âš¡
AsNoTracking alone gives 30–50% speedup on read-only queries by skipping the change tracker.
2. Split Queries
var posts = await db.BlogPosts
.Include(p => p.Tags)
.Include(p => p.Comments)
.AsSplitQuery()
.ToListAsync();
3. Compiled Queries
private static readonly Func<BlogDbContext, string, Task<BlogPost?>> GetBySlug =
EF.CompileAsyncQuery((BlogDbContext db, string slug) =>
db.BlogPosts.FirstOrDefault(p => p.Slug == slug));
Conclusion
Profile first with dotnet-trace, then apply these techniques where they matter most.