Poor performance of COM-component

Hi ALL! I've faced the following issue while programming C++/COM:

1) there is C++ code, let's say it's inside the function void f1();
2) there is inproc DLL COM-component, that is wrapper for code mentioned above, something like

STDMETHODIMP component::run()
{
f1();
return S_OK;
}

I found that original f1() being called from statically linked program works 3-4 times faster, than run() call:

#import "path\\to\\dll\\component.dll"
int _tmain(int argc, _TCHAR* argv[])
{
CoInitialize( NULL );
CComQIPtr<component> ptr;
ptr.CoCreateInstance( OLESTR( "component.progID" ) );
ptr->run();
}

The question is it possible to increase performance of calling COM interface function run()? If yes, how?
Topic archived. No new replies allowed.