ErikEJ / EntityFramework6PowerTools

This is the codebase for Entity Framework 6 Power Tools Community Edition, and modern EF 6 providers for SQL Server and SQL Server Compact
Other
183 stars 27 forks source link

Debugging is slow, release mode is fast #112

Closed mattdresch closed 1 year ago

mattdresch commented 1 year ago

For some reason, only when debugging (in both VS2019 and VS2022) Entity Framework connections and queries are incredibly slow. I don't have the same issue when running in release mode or when the code is deployed on the web server.

I am using Entity Framework 6.4.4 (Database First). The issue disappears when I revert back to using System.Data.SqlClient and EntityFramework 6.1.3, although it of course prevents me from using Azure Managed Identity.

ErikEJ commented 1 year ago

How does 6.4.4 act?

mattdresch commented 1 year ago

Thank you for the reply. 6.4.4 is what I am currently using due to the dependency in the latest version of ErikEJ.EntityFramework.SqlServer

ErikEJ commented 1 year ago

Yes but how does plain 6.4.4 behave?

mattdresch commented 1 year ago

It looks as though 6.1.3 is the latest version that is fine for us. Even upgrading to 6.2.0 we can observe the performance impact (only in debug mode). We were previously at version 6.1.3 but upgraded to 6.4.4 as recommended.

I do see this issue, which never appeared to have been resolved: https://github.com/dotnet/ef6/issues/472

ErikEJ commented 1 year ago

Disable Visual Studio Diganostic tool