This is not a question of “which is the fastest ORM”, and it is not a question of how to write good code with ORM. This is the other side: the code is written, it went live, several thousand users hit the application, but there is a general performance problem. SQL Profiler tracing can only be performed for a short period of time: 5 minutes gives several hundred thousand results.
The question is this: using SQL Profiler to narrow down a number of slow queries (duration longer than a given amount of time), what methods and solutions exist for tracking these SQL queries back to the problem component? The question that has been asked is that if a certain area is slow, how can we identify the SQL that this area is running so that it can be properly filtered in SQL Profiler?
This is based on a rather large application with a rather complex table structure and is currently based on access to data through stored procedures. If there is a problem with SQL performance, you usually have the opportunity to pull out the SQL profiler, find out if there is anything slow (filter by duration) or if the complaint about the region is slow (filter by stored procedure) and configure stored procedures (or schema by indexing).
Now there is a push to move our code from the most-sproc solution mainly to an ORM solution, however, a big push to the movement is how performance problems, if they arise, can be traced to the problem code. I read and it seems that most often it can be third-party tools (ORM trace utilities, such as NHProf or .NET trace utilities, such as dottrace) that we need to install on the server. Now the question of whether additional tools can be installed in a live environment is another question, so if such things can be done without additional tools, then this may be a bonus.
Mostly I'm interested in solutions with SQL Server 2008, but they are probably quite common for any DBMS. As for the ORM technology, I don’t have any special attention on this, because nothing is currently used, so they are interested to know how different methods (or are common) differ from each other: nHibernate, fluent-nhibernate and Entity Framework. Other ORMs are welcome, although if they offer something else :-)
I read How to find and fix performance problems (...) , and I think that the problem is just a section where it says “isolate”. A problem that is easily reproduced only in a living system will be difficult to isolate. The numbers given in paragraph 2 are the types of volumes that we can get from the profile ...
If you have real-world experience with ORM tracing live, the better :-)
Update, 2016-10-21 . For completeness, we eventually decided this for NHibernate by writing code and overriding the NHibernate methods. I asked the full details on this other SO question: NHibernate and Interceptors - SQL pivot time measurement. I expect this to be a similar approach for many different ORMs.