为什么要在一台计算机内使用本地管道代替套接字进行程序通信?是否有任何一项FRESH统计数据表明谁的速度更快,数量如何,哪种情况更少或更少?为什么在一台计算机内使用本地管道代替套接字进行程序通信?
我已经找到了警惕老奇怪和可怕的一个... http://home.iae.nl/users/mhx/pipes&socks.html
There is a noticeable difference in performance between sockets and named pipes.
Benchmark 1: 20 Mbytes copied between two iForths on machine 1;
Benchmark 2: 20 Mbytes copied from an iForth on machine 2 to an iForth on machine 1.
Systems for sock test: Windows XP Pro, running on (1) an Intel PIV 3GHz/1GB and (2) an Intel Core 2 Duo 2.66 GHz/2GB. The PC's were networked using motherboard Realtek network adapters (100 Mbit/s).
Systems for npipe test: Windows NT 4.0, running on (1) an Intel Pentium 166MHz/48MB and (2) an Intel Pentium 200MHz/48MB. The PC's were networked using cheap NE2000 clones (10 Mbit/s).
benchmark | process A read | process B write
===========+================+================
sock bm 1 | 72 MB/sec | 732 MB/sec
sock bm 2 | 11.5 MB/sec | 2.857 GB/sec
npipe bm 1 | 15 MB/sec | 15 MB/sec
npipe bm 2 | 715 KB/sec | 715 KB/sec
而且here是一些奇怪的信息(至少对我来说 - Windows用户)
命名管道不适用于大块数据。如果您最多发送几十个字节的消息,则管道具有相同的性能 – Lothar 2013-01-03 21:40:37