Microsoft Calls Entity Framework Core 7 Preview 6 “The Performance Edition” – Visual Studio Magazine


Microsoft calls Entity Framework Core 7 Preview 6 “the Performance Edition”

“Performance is always a top priority in EF Core,” Microsoft said when announcing the new Entity Framework Core 7 Preview 6 release, which the company dubbed “the Performance Edition.”

It debuted this week with .NET 7 Preview 6.

“For EF Core 6.0, we focused on improving the performance of untraceable queries, achieving very significant speedup and making EF Core comparable to raw SQL queries using Dapper,” said an announcement post from Shay. Microsoft’s Rojansky, who pointed here for more information on this EF6 performance edition. “For EF Core 7.0, we targeted the EF Core ‘update pipeline’: this is the component that implements SaveChanges and is responsible for applying inserts, updates, and deletes to your database.”

While query optimizations in EF Core 6.0 sought to reduce query execution times, the update pipeline enhancements in .NET 7.0 were different, providing opportunities to improve the SQL sent by EF to the core of data, as well as the number of network round trips that occur on a SaveChanges command. Rojansky said the latter is particularly important to modern application performance in these ways:

  • Network latency is usually a big factor (sometimes measured in milliseconds), so eliminating an unnecessary round trip can have far more impact than many micro-optimizations in the code itself.
  • Latency also varies depending on various factors, so eliminating a round trip has an increasing effect the higher the latency.
  • In a traditional on-premises deployment, the database server is usually located close to the application servers. In the cloud environment, the database server tends to be further away, which increases latency.

Rojansky said that in some scenarios, the development team sees a 74% reduction in the time it takes to network round trips: “That’s a fourfold improvement!”

As the release is performance-focused, the bulk of the announcement is devoted to explaining performance improvements in the following areas (with links to quickly access more information on each):

Highly requested features
[Click on image for larger view.] Highly requested features (source: Microsoft).

Going forward, the plan for Entity Framework Core 7.0 lists the highly requested features, described above.

Open questions
[Click on image for larger view.] Open questions (source: Microsoft).

Specifically, the team will address numerous open issues listed in the project’s GitHub repository, some of which are listed in the graphic above.

As can be seen, “Map JSON values ​​stored in the database to EF properties” tops the list when ranked by the number of 👍 reactions.

Much more information about the plan for EF7 can be found in the GitHub page “issues and feature requests for EF Core”, along with EF Core releases and the planning roadmap.

About the Author

David Ramel is an editor and writer for Converge360.

Briana R. Cross