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

  • 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.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube