BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Microsoft Reports Significant Performance Improvements in Entity Framework 5

by Jenni Konrad on Feb 16, 2012 |

Microsoft has announced that the upcoming Entity Framework (EF) 5 could potentially improve performance up to 67 percent over EF 4.

According to the ADO.NET team blog, the application performance improvements they've seen in this version of EF are partly due to auto-compilation of LINQ to Entities queries. The feature has always been a part of the framework, but developers had to call CompiledQuery.Compile to take advantage of it. This will now be handled automatically in EF 5: the first time a query is run, it's compiled and cached, so that successive requests can avoid the compilation step completely.

EF 4 made use of a compiled query cache for ESQL queries, and EF 5 is extending this functionality to LINQ to Entity queries. Once the cache reaches 800 compiled queries an eviction algorithm kicks in that will clean the cache periodically, once every minute. Entries are removed from the cache on a LFRU (Least frequently – recently used) basis.

Performance also improves using compiled LINQ to SQL queries. The ADO.NET team notes some changes to the way that query parameters are evaluated, which has resulted in up to 600 percent performance improvements in their internal testing.

Despite efforts to deliver .NET Framework and EF releases independent of one another, the frameworks still share some core libraries: System.Data.Entity.dll, System.Data.Entity.Design.dll, and System.Web.Entity.dll. The upside to this fact is that developers using EF 4.0 should also experience performance improvements just by upgrading to .NET Framework 4.5.

Because some of the new features in EF 5, such as Enum support and Spatial datatypes, are dependent on functionality in .NET Framework 4.5, it is not expected until after .NET 4.5 is released. Microsoft announced the availability of EF 4.3 earlier this month.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT