Rel*_*lla 4 sockets statistics ipc named-pipes
为什么在一台计算机内使用本地管道而不是套接字进行程序通信?有没有一个关于谁更快和更多的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
Run Code Online (Sandbox Code Playgroud)
而这里是一些奇怪的信息(至少对我来说- Windows用户)
管道应该总是更快,因为它们完全绕过主机操作系统上的网络堆栈.管道被认为更安全,因为它们不监听来自不受信任的远程计算机的数据(尽管套接字也可以配置为仅监听环回适配器,从而避免收听远程计算机).命名管道不如套接字灵活,因为它们不允许网络通信.在任何一种情况下,安全性仍然与您编写代码的程度有关.可以编写基于管道的应用程序,该应用程序不如基于套接字的应用程序安全.
至于一个比另一个更快的速度取决于你的硬件和操作系统.
| 归档时间: |
|
| 查看次数: |
2882 次 |
| 最近记录: |