You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an entity hierarchy with a root entity that has several collections of dependent entities (the collections are big enough), some of the dependents may have their own dependent entities, and so on.
When some entities are removed from the root's collections, the call of SaveChangesAsync is extremely slow. It seems that the slowdown is caused by change detection during cascade delete (because all parents and their navigation collections are checked). But it's possible to disable auto change detection, manually call DetectChanges before SaveChangesAsync and drastically increase performance:
We have an entity hierarchy with a root entity that has several collections of dependent entities (the collections are big enough), some of the dependents may have their own dependent entities, and so on.
When some entities are removed from the root's collections, the call of
SaveChangesAsync
is extremely slow. It seems that the slowdown is caused by change detection during cascade delete (because all parents and their navigation collections are checked). But it's possible to disable auto change detection, manually callDetectChanges
beforeSaveChangesAsync
and drastically increase performance:Steps to reproduce
Version
EF Core: 8.0.8
Target framework: net8.0
Operating system: Ubuntu 24.04
The text was updated successfully, but these errors were encountered: