CodingPleasure

cultivate passion for everything else that goes on around programming

Optimizing Entity Framework 3.5

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

http://msdn.microsoft.com/en-us/library/bb896240.aspx

 

The
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:

 

 

The
highlighted line is a ObjectContext with about 60 entities. I’m pretty
satisfied with the Speedup improvement
J
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.

 

After
doing all this I found the following link on CodeProject:

http://www.codeproject.com/KB/database/PerfEntityFramework.aspx

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

 

 

 

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 )

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 )

w

Connecting to %s

%d bloggers like this: