When using the profiler in Visual Studio to track down expensive functions, I've seen on occasion that most of the work ends up being in [clr.dll]. That basically amounts to a black box, and I'm wondering if there's a way to track down why it's spending so much time there.
I assume that clr.dll handles stuff like JIT compiling, loading assemblies and managing appdomains, garbage collection, reflection, etc. But it makes it really difficult to actually tell what code is causing it to spend so much time.
Obviously it's some other code besides the runtime itself that is causing it to spend that much time in clr.dll, so how do you track down what code is at fault?