Data Driver

Blog archive

Microsoft Boosts Performance in Entity Framework 5.0

The Microsoft ADO.NET team today announced that the upcoming Entity Framework 5.0 could boost application performance by some 67 percent over EF 4.0.

Reducing data access overhead in the O/RM and other performance tweaks resulted in one internal test that showed "repeat execution time of the same LINQ query has been reduced by around 6x," the team said in a blog post.

One improvement involves automatically compiling LINQ to Entities queries. Developers have long been able to compile such queries explicitly via a CompiledQuery.Compile method call, but apparently they weren't aware of the feature or found the API more difficult to work with than regular LINQ, the team said. (You can read about the nuts and bolts of automatic compilation here.) Now the translation of inline LINQ queries is automatically cached and CompiledQuery is no longer necessary.

In comparison tests of EF 4.0 and EF 5.0 involving a repeated query executed with ADO.NET, LINQ to SQL and various EF methodologies, "we've improved the performance of LINQ to Entities queries nearly 600%," the team said.

Of course, you shouldn't expect that kind of improvement in your real-world applications. "It would be amazing if we could give you 600% improved performance across the board," the team said. "Unfortunately, most applications do more interesting things than run the same query repeatedly."

However, a suite of tests simulating typical usage in real-world apps showed a 67 percent performance increase after the server was upgraded from EF 4.0 to EF 5.0. "These numbers are based on an internal build, but we're working hard to get a build available for public verification of these improvements," the team said.

Just upgrading to .NET 4.5 will provide these performance improvements to EF 4.0 apps. The ADO.NET team has stated it wants to start shipping EF versions separately from the .NET Framework, but there were some upgrade issues that required core library updates, so some EF improvements have to wait for .NET 4.5. "This includes support for Enum Types, Spatial Types, Table-Valued Functions, Stored Procedures with Multiple Results and Auto-Compiled LINQ Queries," an earlier blog post said.

Also, last week the final go-live release of EF 4.3 was announced, including improvements to Code First migrations, some bug fixes and several other tweaks.

The ADO.NET team blog post about EF 5.0 improvements is brand-new at the time I write this, so no readers have weighed in with comments yet, but I'll keep an eye out for any developer concerns or interesting feedback. In the meantime, you can comment here or drop me an e-mail.

Posted by David Ramel on 02/14/2012


comments powered by Disqus

Featured

  • Full Stack Hands-On Development with .NET

    In the fast-paced realm of modern software development, proficiency across a full stack of technologies is not just beneficial, it's essential. Microsoft has an entire stack of open source development components in its .NET platform (formerly known as .NET Core) that can be used to build an end-to-end set of applications.

  • .NET-Centric Uno Platform Debuts 'Single Project' for 9 Targets

    "We've reduced the complexity of project files and eliminated the need for explicit NuGet package references, separate project libraries, or 'shared' projects."

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

Subscribe on YouTube