Entityframework.docs: Performance Guidance

Created on 1 Jul 2016  路  8Comments  路  Source: dotnet/EntityFramework.Docs

Some things already mentioned in various docs. Would be nice to have one doc dedicated to all the perf tips.

Some ideas:

  • [ ] Streaming vs buffering (IEnumerable/IAsyncEnumerable vs. ToList/ToListAsync). Possibly refer from https://docs.microsoft.com/en-us/ef/core/querying/how-query-works#when-queries-are-executed.
  • [ ] Split/single queries
  • [ ] Perf counters
  • [ ] Tracking vs no-tracking (per query, per type, etc.)
  • [ ] DbContext pooling
  • [ ] Compiled queries
  • [ ] FromSql for complex queries
  • [ ] INotifyPropertyChanged
  • [ ] Key generation: sequence vs identity
  • [ ] Batching (configuring sizes, networking conditions, etc)
area-perf

Most helpful comment

@Rick-Anderson yeah, this should be reviewed case-by-case, lots of things are relevant, some probably aren't... This is one of the major docs tasks on my plate.

All 8 comments

Any progress on this? In particular looking for SQLite+UWP perf tips.

@bartlannoeye the perf issues in UWP/SQLite are bugs that we're working with the .NET Native team to address. Unfortunately there isn't really any way to work around them.

Putting this on the backlog. A lot of the perf guidance from EF6 doesn't really apply to EF Core and I'm not sure how much we need to document here. I think it probably makes sense to wait a bit longer and see what kind of things aren't obvious to most folks, and then document these.

@divega a Short perf doc would be beneficial and would surely grow as customers contributed their perf findings. https://github.com/aspnet/Docs/pull/964 has a short EF perf section. It would be better to move that section to this repo and the ASP.NET Core perf doc could point to it.

@Rick-Anderson The short EF section I read in the PR seems like a good start of a page on the EF Core side. I posted some comment that hopefully can make it better.

There a few things remaining here that of course also have value, although at this point I think I would leave the "Key generation: sequence vs identity" part out.

Consult https://docs.microsoft.com/en-us/ef/ef6/fundamentals/performance/perf-whitepaper

But isn't Rowan correct

A lot of the perf guidance from EF6 doesn't really apply to EF Core

@Rick-Anderson yeah, this should be reviewed case-by-case, lots of things are relevant, some probably aren't... This is one of the major docs tasks on my plate.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ajcvickers picture ajcvickers  路  4Comments

MohammadMQ picture MohammadMQ  路  3Comments

jaxidian picture jaxidian  路  4Comments

MCcoder52 picture MCcoder52  路  3Comments

davidliang2008 picture davidliang2008  路  4Comments