Speed of named pipe vs tcp/ip vs shared memory

I have found this article interesting.

However before using named pipe i would like to have some justifications in terms of few practal points.

The article suggest named pipe as robust tool for inter communication or data exchange in the local machine.

I think both shared memory and tcp/ip can probably do the same task as named pipes.

What i am interested in knowing is which method is preferred in term of communication speed and their CPU overhead transfering data on local machine. For example imagine the case where two application need to exchange data on the same computer.

I also would like to know if named pipes and shared memroy can be used to communicate on remote machine for data exchange like client connecting server on other computer ?

I think it is probably difficult to compare each techniques for the same task because non of us will implement all these three techniques for one task.

So google does not really useful to get sufficient answers.

If you have some practical knowledge please feel free to share. It will be appreciate by many forum members.

Data exchange Speed on local machine is probably biggest concern for me.

Thanks in advance for you sharing. :slight_smile:

The problem of named pipes (and sockets) are that they need to have a sever and a client and the server is blocked until it gets something - like OnTick() nothing happens within that function until a tick comes in.

Memory mapped files don’t have that problem but you have to find a solution to manages ‘incoming’ content.

PS: I think that even named pipes aren’t written to a hard drive and have to be read form there but they stay in the memory as well - so I think that they are as fast as mem. mapped files or shred memory.

I am assuming that there is some data to be exchanged like server or client context. I am asking the speed of the round trips like latency.

Have you got any ideas if tcp/ip and shared memory or named pipes are exchanging data inside local machine, which method do you think fastest ?