Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Communication between applications

I have 3 choices to use : sockets, activeX, com , in order to communicate between applications on one computer. Which is faster ?

like image 513
Zlobaton Avatar asked Mar 03 '11 13:03

Zlobaton


1 Answers

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.

like image 85
Hans Passant Avatar answered Sep 22 '22 09:09

Hans Passant