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
2009-09-08 12:44:30
How?
Kieveli
2009-09-08 13:02:44
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
2009-09-08 13:06:58
What does that mean? Sorry, I'm a bit green when it comes to this stuff.
max
2009-09-08 13:08:11
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
2009-09-08 13:10:31
+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
2009-09-09 12:05:30