Click here to Skip to main content
15,847,653 members
Home / Discussions / COM
   

COM

 
GeneralRe: in-proc ==>> Out-of-proc Pin
Vi215-Jul-03 3:29
Vi215-Jul-03 3:29 
GeneralRe: in-proc ==>> Out-of-proc Pin
In-At15-Jul-03 3:42
In-At15-Jul-03 3:42 
GeneralSpeed of COM Pin
Jo Fredrickson6-Jul-03 22:02
Jo Fredrickson6-Jul-03 22:02 
GeneralRe: Speed of COM Pin
In-At7-Jul-03 0:30
In-At7-Jul-03 0:30 
GeneralRe: Speed of COM Pin
In-At7-Jul-03 0:58
In-At7-Jul-03 0:58 
GeneralRe: Speed of COM Pin
Jo Fredrickson7-Jul-03 17:03
Jo Fredrickson7-Jul-03 17:03 
GeneralRe: Speed of COM Pin
In-At7-Jul-03 20:59
In-At7-Jul-03 20:59 
GeneralRe: Speed of COM Pin
Mike Dimmick12-Jul-03 9:10
Mike Dimmick12-Jul-03 9:10 
As long as the threading model of the thread matches that of the component, there shouldn't be any proxy/stub work going on, and the call into the component is just a virtual function call, which isn't much more costly than a non-virtual call.

If both parts (client and component) are written in C++, or if the client is VB6, try to ensure that your component exposes a vtable interface as well as the dispatch interface - a dual interface, as it's known. This is basically a custom interface derived from IDispatch, so that callers which can early bind do so, while late-binding callers aren't shut out.

If the threading model of the component doesn't match the threading model of the caller, COM will introduce a proxy and stub to marshal between the caller and the component within the thread. This is less costly than having the component as a local server process, but more costly than a plain call.

This might happen if your component is marked 'Free' but your client is either VB6, or calls CoInitialize or CoInitializeEx( NULL, COINIT_APARTMENTTHREADED ); to initialise COM from C++. If the component is marked 'Both', it will behave as if you'd specified 'Apartment' if the thread that created it runs in the Single-Threaded Apartment (conditions as above), or 'Free' if the creator runs in the Multi-Threaded Apartment.

I suspect, though, that your database accesses are what's killing you. Measure the actual performance of Access on that system configuration. It's going to be sluggish - indeed with only 24Mb of RAM, it's likely to be constantly swapping.

Generally it's a good idea to compile your app with the 'Minimize Size' compiler options - in VB, this is Project Properties > Compile tab > select Compile to Native Code and Optimize for Small Code.

In VC 6.0, I use the /Oxs option - full optimization, favor small code - and the /Og option - global optimizations. I also use /Gy (enable function-level linking) and specify /OPT:REF to the linker (Remove unreferenced functions). This last is the default, but it gets turned off if you generate debugging information for the release build, which I do. Specifying /OPT:WIN98 might improve your startup time on Windows 98.

Doing this can reduce your code size, which can reduce the number of page faults you take.

You could also try using a profiler to find out where the hotspots are. The Win32 SDK contains a tool called the Call Attributed Profiler, or CAP.

--
Mike Dimmick
GeneralRe: Speed of COM Pin
Jo Fredrickson14-Jul-03 19:05
Jo Fredrickson14-Jul-03 19:05 
GeneralRe: Speed of COM Pin
Gerald Schwab20-Jul-03 18:23
Gerald Schwab20-Jul-03 18:23 
GeneralATL Control sinks Pin
Ancient Dragon4-Jul-03 4:32
Ancient Dragon4-Jul-03 4:32 
GeneralAccessing COM objects Pin
Moonspellwizard3-Jul-03 20:44
Moonspellwizard3-Jul-03 20:44 
GeneralRe: Accessing COM objects Pin
In-At3-Jul-03 21:17
In-At3-Jul-03 21:17 
GeneralADO Pin
Anthony98873-Jul-03 10:51
Anthony98873-Jul-03 10:51 
GeneralRe: ADO Pin
Anonymous3-Jul-03 12:51
Anonymous3-Jul-03 12:51 
GeneralMultiple instances are launched Pin
In-At2-Jul-03 21:42
In-At2-Jul-03 21:42 
GeneralIn-proc to out-of-proc Pin
In-At2-Jul-03 21:19
In-At2-Jul-03 21:19 
GeneralRe: In-proc to out-of-proc Pin
valikac3-Jul-03 8:39
valikac3-Jul-03 8:39 
GeneralRe: In-proc to out-of-proc Pin
In-At3-Jul-03 20:54
In-At3-Jul-03 20:54 
GeneralRe: In-proc to out-of-proc Pin
valikac4-Jul-03 6:00
valikac4-Jul-03 6:00 
GeneralHelpppppp! Pin
safee ullah2-Jul-03 21:07
safee ullah2-Jul-03 21:07 
Generalhelp!!,there are some errors in my program Pin
yingkou2-Jul-03 4:35
yingkou2-Jul-03 4:35 
Generalremote connection to server Pin
satishsilla2-Jul-03 3:59
satishsilla2-Jul-03 3:59 
Generaldefault properties on COM interfaces Pin
Dave Bryant1-Jul-03 17:26
Dave Bryant1-Jul-03 17:26 
GeneralRe: default properties on COM interfaces Pin
Mil101-Jul-03 19:59
Mil101-Jul-03 19:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.