We installed miniprofiler. It has been an edifying experience, but now we see that our database queries run 3x as fast with the profiler enabled as with it disabled.
The only code we changed in our app was to add the profiledDbConnection:
public static DbConnection GetOpenConnection(string connectionString)
{
var cnn = new System.Data.SqlClient.SqlConnection(connectionString);
// wrap the connection with a profiling connection that tracks timings
return MvcMiniProfiler.Data.ProfiledDbConnection.Get(cnn, MiniProfiler.Current);
}
Linq2Sql is suddenly...fast.
I'm not complaining, but why is this happening?