EF Core didn't ruin your performance. The defaults did.
Every few months someone declares that Entity Framework is the reason their application is slow, and the proposed cure is a heroic rewrite to raw SQL or a different ORM. Occasionally that's right. Usually, the profiler tells a less dramatic story: the application is slow because of how the ORM is being used, and the same hands would produce the same patterns in any tool.
The usual suspects
N+1 queries. A loop that looks innocent in C# — iterate orders, touch each order's customer — becomes one query plus one query per row. It's invisible in development against fifty rows and catastrophic in production against fifty thousand. The fix is deliberate loading (Include, projections), but the real fix is visibility: log the SQL in development and the pattern announces itself.
Fetching entities to answer questions. Loading full tracked entities — change tracker and all — to compute a count or fill a read-only grid. Projections to slim DTOs, and AsNoTracking for anything you won't modify, routinely cut both query cost and memory. Read paths and write paths are different problems; the code should admit that.
Indexes designed by hope. The query was fast when the table was small. Growth is not a performance bug; it's a schedule. SQL Server's Query Store will tell you exactly which queries regressed and when — evidence, not vibes — and most "the app got slow last month" mysteries resolve into one missing index and one query that stopped using an existing one.
Where the ORM genuinely isn't the tool
Fairness requires the other half: bulk operations, complex reporting queries, and hot paths measured in microseconds are places to drop to SQL deliberately — through the same DbContext, versioned and reviewed like any other code. The mature position isn't "always EF" or "never EF." It's knowing which 5% of your data access deserves hand-tuning, and having the measurements to prove which 5% that is.
That's typically our first data engagement in one sentence: turn on the instruments, read them, fix the top ten. It's rarely glamorous. It's usually a week. The application is usually transformed.
← All insights