Description
I came across this page looking for already-compiled benchmark/performance info on the difference between AsNoTracking() and AsNoTrackingWithIdentityResolution() for cases where the resulting graph contains multiple references to the same document. I expected (especially given that the document has ben recently updated) that, in addition to the comparisons between AsNoTracking() and AsTracking(), I would find a comparison with AsNoTrackingWithIdentityResolution().
The goal is to understand the performance impact (cpu and primarily gc pressure) of relying on AsNoTrackingWithIdentityResolution() vs manually deduplicating the object graph by only selecting the id and then using a separate pass to assign the referenced value by querying against the previous results of a separate AsNoTracking() db query for the values for a case where the bulk of the objects in the resulting object graph (of thousands of records) are unique (i.e. would not benefit from identity resolution) but have a single navigation property pointing to one of a dozen or so discrete objects which I would want deduplicated to avoid the memory pressure if I were to Include() that navigation property with AsNoTracking().
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 4e33b6d9-4d54-138e-7ba2-a1cfbda8b233
- Version Independent ID: a079c83a-fa76-efb6-e744-d01177379fce
- Content: Efficient Querying - EF Core
- Content Source: entity-framework/core/performance/efficient-querying.md
- Product: entity-framework
- Technology: entity-framework-core
- GitHub Login: @roji
- Microsoft Alias: avickers