Common mistakes in EF Core
summary
Benchmarks show specific, fixable mistakes: casting queries to IEnumerable causing full-table downloads can spike memory to 2 GB and turn a 128 ms count into 33 s under load (up to ~260× slower in load tests); using AsNoTracking saves ~4× memory and speeds reads; unnecessary Include calls slow queries (~2.5×) and implicit selects avoid joins; correct server-side pagination yields ~18× faster responses; cancellation tokens halve average latency and prevent machines from becoming unresponsive; EF Core 7 ExecuteUpdate enables single-statement bulk updates.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 3:12Speaker setup
- 7:48Benchmark tools overview
- 9:58Seven deadly sins
- 10:19Casting to IEnumberable
- 16:06Ignoring AsNoTracking
- 20:58Overusing Include
- 23:58Improper pagination
- 29:42Forgetting cancellation tokens
- 35:31Inefficient updates/deletes
- 41:38Honorable mentions
- 45:09DB context pooling
- 48:24Tagging queries
- 50:12AI for query optimization
- 56:58Premature optimization
- 1:00:07Resources and closing
related talks
01h 05mCommon mistakes in EF Core
01h 04mCommon mistakes in EF Core
01h 01mEntity Framework Core Unchained Getting the Best Performance from Your ORM
47mEF Core 6: Working on the Bucket List
01h 00mGetting the best out of Entity Framework Core
59mEF Core 6: Fulfilling the Bucket List
01h 01m10 things you didn't know EF Core can do
56mEntity Framework debugging using SQL Server: A Detective Story
