Performance on Entity Framework

EntityFramework Performance and AutoDetectChanges

Speeding up Entity Framework queries with CompiledQuery

Performance and the Entity Framework

Performance Considerations (Entity Framework)

Why is inserting entities in EF 4.1 so slow compared to ObjectContext?

Fastest Way of Inserting in Entity Framework

Obviously, the speed on executing EF Queries is slow so these articles (and more out there in the web) describe about the EF performance and small tips how to optimize/reduce the actual operation time in EF.

The ones that I have been using are two properties in DbContextConfiguration ; AutoDetectChanges, ValidateOnSaveEnabled. Since EF keeps tracking changes on changes/updates/insert and validating data when saving, briefly saying, EF does check for data’s navigation properties and all related data. That’s why it is slow for executing queries.

But be cautious that if you set those properties to ‘false’ before DbContext.{Add/Insert/Update/SaveChanges} calls, then it would be a better idea you set them back to ‘true’ once done. Because having them ‘true’ enables the EF performs the auto data validation and checking on data-relationship for you.

Enjoy reading articles! 🙂