tags:

views:

105

answers:

2

My software makes heavy use of COM. It is very, very slow. Is there some trick to speeding COM communication up?

+2  A: 

If you're not already doing that, run the component in-process rather than in a separate server process (dllhost.exe).

Mehrdad Afshari
How?
Kieveli
Kieveli: Depends on the specific environment. At the API level, you choose the creation context of a COM object by passing the appropriate argument to the context parameter of `CoCreateInstance` function.
Mehrdad Afshari
What does that mean? Sorry, I'm a bit green when it comes to this stuff.
max
max: This is probably what you're already doing. You should add a bit more context to your question for a more useful response (or you can ask another question about optimizing your specific situation rather than a broad one). In the meantime, you can see http://msdn.microsoft.com/en-us/library/ms693716(VS.85).aspx for different options (process-wise) you have when you're creating a COM object.
Mehrdad Afshari
+1  A: 

Run a Profiling tool to measure exactly what is causing the slowness of the system. COM may seem like a good rain to blame, but sometimes slowness is caused by things you don't expect. It's not always the piece that you understand the least that causes problems.

Once my entire application was running slow due to a custom string implementation that was being used. Using the profiler saved the day.

Kieveli