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! 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s