有人做过boost::asio的性能分析吗?

发布于 2024-08-12 06:46:22 字数 503 浏览 1 评论 0原文

我需要类似套接字的本地IPC。我在 Windows 上使用了命名管道和重叠 IO,并且我想将应用程序重写为 boost::ASIO,以便它也可以使用 UNIX 域套接字。

我最近查看了 libevent 库的部分内容,我知道它仅支持 1.4 版本中的 windows 的 socket() 和 select() 。由于重叠 IO 非常高效,因此将其排除在外显然是一个不可接受的特性,该特性正在版本 2(处于 alpha 版本)中得到解决。次优实现的另一个例子是使用红黑树与 prio 队列作为超时逻辑,这是 地址沿线的某个地方。

有人对 boost 与 libevent/libev 的性能特征有什么意见吗?它在某些平台上是否有任何明显的不良特征?我提出这个问题的目的是,除非绝对必要,否则我不想对 ASIO 库进行 pidgeon-hole 操作。我想知道 boost::asio 是否以最优化的方式使用最优化的操作系统原语。

I require socket-like local IPC. I used named pipes and overlapped IO on windows and I want to rewrite the application to boost::ASIO so that it can use UNIX domain sockets as well.

I've recently reviewed parts of the libevent library and I know it only supports socket() and select() for windows in the 1.4 version. As overlapped IO is very efficient leaving it out is obviously an unacceptable trait which is being adressed in version 2 (which is in alpha). Another example of sub-optimal implementation is the use of red-black trees vs. prio-queues for the timeout logic which was adressed somewhere along the line.

Does anyone have any opinions on the performance characteristics of boost vs libevent/libev. Does it have any glaring undesireable traits on certain platforms ? My aim for this question is that I do not want to pidgeon-hole the ASIO library unless I absolutely must. I want to know if boost::asio uses the most optimal OS primitives in the most optimal way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

空心↖ 2024-08-19 06:46:22

我对 asio 和我自己的文件读取实现进行了性能测试(我的博文条目) - 用两个词来说 - asio 表现出了良好的效果。

I do performance tests of asio and my own impl on file reading (my blogpost entry) - in two words - asio shown good results.

寂寞美少年 2024-08-19 06:46:22

另外查看这篇文章了解boost中的锁定问题::asio,这可能会影响你。

Also check this post about a locking problem in boost::asio, which may affect you.

酷遇一生 2024-08-19 06:46:22

在我看来,Boost.AsioWindows-First,而大多数其他自由软件库是Linux-First。然而Linux下的质量一直都很好。由于该软件受到了 20 名未参与其开发的人的审查。在提问者提出这个问题时(2009 年),Linux 下多线程的速度已经得到了迅速提高: http:// /think-async.com/Asio/LinuxPerformanceImprovements

Windows 下的速度一直都不错。我最大的抱怨是 UDP 套接字的设计,它的实现很糟糕。

In my opinion Boost.Asio is Windows-First, where most other free-software libraries are Linux-First. However the quality under Linux has always been good. Since this software got reveiwed by 20 people who did not participate in its development. Speed under Linux with multiple threads has been rapidly improved around the time the asker asked this question (2009): http://think-async.com/Asio/LinuxPerformanceImprovements

Speed under Windows has always been good. My biggest gripe is the design of UDP sockets, it is poorly implemented.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文