Profiling with COM

We have been using dotTrace for a few weeks now and it has been a great help with enhancing our application's performance.  I wasn't able to find any other posts on this.  Our C# system utilizes some 3rd party unmanaged dll's, but we've been getting some inconsistent results as we profile closer to the COM layer. 

For example if we have a function like the following,

public void SomeFunction()

where myComDllClass is an instance of a class from a 3rd party unmanaged COM Interop dll.

Let's assume the SomeCOMMethod function takes 1000ms to execute.  Sometimes the profiler will show the SomeFunction method as taking 0ms (without child functions) and the SomeCOMMethod function taking 1000ms (this is what would be expected), however other runs would show the SomeFunction method taking 1000ms and the SomeCOMMethod taking 0ms - or an allocation somewhere in between.  The overall time is always consistent (in this case 1000ms) so it doesn't seem that the overall performance data is incorrect.

It is important for us to be able to quantify how much time we are spending in our dll's and how much time is being spent in the 3rd party Interop dll's.  Is there any explanation for this?  Has anyone else seen similiar behavior?


Hi Matt,

First, I have to understand which profiler options you choose to start your application.

WBR, Mikhail Pilin


I'm doing performance profiling (obviously) set to start profiling immediately.  Tracing Profiling and Record thread time is set as well as Allow inlining functions.  Should these settings be different?


Dear Matt,

I recomed you to use the wall time in you application in tracing mode.

WBR, Mikhail Pilin


Please sign in to leave a comment.