I have 3 choices to use : sockets, activeX, com , in order to communicate between applications on one computer. Which is faster ?
As long as this runs on one machine, interprocess communication is fundamentally throttled by the bus bandwidth. A memory-to-memory copy, whether that's done in the TCP/IP stack, the named pipe support code or shared memory. Which makes them all equally efficient.
One detail matters though, the amount of data that's transferred and the number of software layers you travel through to get the job done. The memory bus bandwidth only throttles when the amount of data is large. That isn't necessarily the case for a remote procedure call protocol like COM. Only the arguments of the function call needs to be serialized, that could be only a handful of bytes if you don't pass arrays. Now the overhead starts to matter, there's a fair amount of it when you use a high-level protocol like COM.
The obvious disadvantage of using sockets is that you'll have to write all the de/serialization code yourself. Nontrivial if the protocol with the component isn't simple. Trading your working hours for convenience is the typical choice, only you can make it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With