cultivate passion for everything else that goes on around programming

Optimizing Entity Framework 3.5

a struggle to squeeze the most of EF, I found this link:


performance problem for the first ObjectContext initialization is the
generating of the context’s views. These are some internal used views, which
the developer should not know about. But the generation at run-time is
time-consuming and can be done up-front, at compile/build time. So I followed
the steps mentioned in the link above and finally managed to get the following
measured performance improvement:



highlighted line is a ObjectContext with about 60 entities. I’m pretty
satisfied with the Speedup improvement
All in one, I could say that after pre-compiling the view, for the particular
scenario I profiled, the response was about 1 second faster.


doing all this I found the following link on CodeProject:

mentioned there, the pre- generation of the view is the practice with the most
impact on the performance of the Entity Framework. Another optimization I will
implement next: precompiled queries!





Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this: