Dotnet Performance Counter:CLR Interop

In this article we are going to know about performance counters related to CLR Interop.
As we monitor dotnet run time environment (CLR) during performance test, we need to know what to look for if we are measuring performance affected by Interop processing. This indicates application interaction/usages with COM components, COM+ services, and external typed libraries.

Numbers of  of CCWs : Shows current number of COM callable wrappers (CCWs). That means, it actually shows number of managed objects for unmanaged COM code.
Note : CCW is a proxy for a referenced managed object by an unmanaged COM client.

Number of Stubs : Current number of stubs created by CLR.
Marshaling arguments and return values from managed to unmanaged code is done by Stubs during a COM interop call or a platform invoke call.

Number of marshaling : Total number of marshaled events since application started. Arguments & returned values marshaling between managed and un-managed code are in this count.
>This counter is not incremented if the stubs are inlined(they are usually inlined when small marshaling overhead )

Note : This counter usually ignored for managed code base. But if you are using legacy code base or libraries, this needed to monitor. The key thing to monitor is CCWs and if data transaction is large with unmanaged code, then Stubs.

Thanks..:)