使用共享内存解决方案可获得最佳结果。
最近我遇到了同样的IPC基准测试。我认为我的结果将对所有想比较IPC性能的人有用。
管道基准测试:
Message size: 128
Message count: 1000000
Total duration: 27367.454 ms
Average duration: 27.319 us
Minimum duration: 5.888 us
Maximum duration: 15763.712 us
Standard deviation: 26.664 us
Message rate: 36539 msg/s
FIFO(命名管道)基准测试:
Message size: 128
Message count: 1000000
Total duration: 38100.093 ms
Average duration: 38.025 us
Minimum duration: 6.656 us
Maximum duration: 27415.040 us
Standard deviation: 91.614 us
Message rate: 26246 msg/s
消息队列基准测试:
Message size: 128
Message count: 1000000
Total duration: 14723.159 ms
Average duration: 14.675 us
Minimum duration: 3.840 us
Maximum duration: 17437.184 us
Standard deviation: 53.615 us
Message rate: 67920 msg/s
共享内存基准测试:
Message size: 128
Message count: 1000000
Total duration: 261.650 ms
Average duration: 0.238 us
Minimum duration: 0.000 us
Maximum duration: 10092.032 us
Standard deviation: 22.095 us
Message rate: 3821893 msg/s
TCP套接字基准测试:
Message size: 128
Message count: 1000000
Total duration: 44477.257 ms
Average duration: 44.391 us
Minimum duration: 11.520 us
Maximum duration: 15863.296 us
Standard deviation: 44.905 us
Message rate: 22483 msg/s
Unix 套接字基准测试:
Message size: 128
Message count: 1000000
Total duration: 24579.846 ms
Average duration: 24.531 us
Minimum duration: 2.560 us
Maximum duration: 15932.928 us
Standard deviation: 37.854 us
Message rate: 40683 msg/s
ZeroMQ基准测试:
Message size: 128
Message count: 1000000
Total duration: 64872.327 ms
Average duration: 64.808 us
Minimum duration: 23.552 us
Maximum duration: 16443.392 us
Standard deviation: 133.483 us
Message rate: 15414 msg/s
tcp://
与ipc://
进行比较)?您能否提供一个公正的苹果对苹果的比较结果,其中Enduro/X和ZeroMQ都使用IPC
**? - user3666197tcp://
(用于群集分布式 SIGs)、inproc://
(用于最快/最低延迟的进程间消息传递)和epgm://
(用于最终内容流)。性能扩展是如何实现的——一旦添加了2、4、8、16、32、64、128、256、512、1024 个对等体到给定数量的 I/O 线程下(.Context()
引擎可以操作)? - user3666197