I want to diagnose some performance issue related to entity framework but at the moment I'm getting only large numbers on System.Linq.Queryable. Can I somehow configure VS Studio 2010 Ultimate to include referenced .NET assemblies in profiling / instrumentation? I downloaded .NET 3.5 soruces and symbols and tried to allow their debugging but it didn't help.
Asked
Active
Viewed 337 times
0
-
Your performance problem is most likely not in the Entity Framework or .NET code, but in the SQL code that EF is generating. The SQL can be improved through better database design, and other factors. Although the article is a bit dated, you can find some guidance here: http://www.codeproject.com/KB/database/PerfEntityFramework.aspx – Robert Harvey Mar 23 '11 at 21:34
-
@Robert: I'm pretty sure it is not in SQL. I already checked it in SQL profiler and also evaluated execution plans of created queries. – Ladislav Mrnka Mar 23 '11 at 21:38
-
Have you explored lazy vs. eager loading, and similar issues? – Robert Harvey Mar 23 '11 at 21:41
-
If you can run it under the IDE, can you [try this?](http://stackoverflow.com/questions/2473666/tips-for-optimizing-c-net-programs/2474118#2474118) It's simple, but it finds problems. – Mike Dunlavey Mar 24 '11 at 01:31
1 Answers
2
You cannot modify signed assemblies, and this includes instrumenting .Net assemblies. But sample profiling can take you a very long way and is non-invasive (does not require instrumentation).

Remus Rusanu
- 288,378
- 40
- 442
- 569
-
Unfortunatelly still no luck. I'm able to debug .NET assemblies and step into their code but sampling also doesn't show called functions. – Ladislav Mrnka Mar 23 '11 at 21:57
-
@Remus: That is hopefully the missing step but I don't know how to configure it. I just tried run sampling on System.Data.Entity.dll directly but again I received samples only from my code. – Ladislav Mrnka Mar 23 '11 at 22:12
-
Try the advice in http://msdn.microsoft.com/en-us/library/bb385766%28v=VS.100%29.aspx. – Remus Rusanu Mar 24 '11 at 01:28
-
Last time I checked, the VS sampler only looked at CPU usage. It does not sample during I/O. That means, even if the program spends 99% of its time doing needless I/O, it will look like something CPU-bound is the problem. – Mike Dunlavey Mar 24 '11 at 01:35