Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Edited Issue: UpForGrabs: Eager and lazy loading has quadratic complexity [591]

$
0
0
When navigation property is populated Add method is called on RelatedEnd class in loop. Add method internally calls CheckIfNavigationPropertyContainsEntity on EntityCollection class - this method contains another loop iterating over all items in the navigation property. Filling navigation property this way has quadratic complexity because each added item is compared with all already added items.

It was reported second time on Stack Overflow as a performance issue:

http://stackoverflow.com/questions/7403149/entity-framework-performance-issue
http://stackoverflow.com/questions/12898790/codefirst-loading-1-parent-linked-to-25-000-children-is-slow

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>