同步操作将从 zieckey/evpp 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The IO Event performance benchmark test of evpp against Boost.Asio
We do a throughput benchmark test here benchmark_throughput_vs_asio which shows evpp has a similar performance with asio.
And we also do another benchmark about IO event performance and throughput here benchmark_ping_pong_spend_time_vs_asio.md which shows evpp's performance is about 5%~20% higher than asio.
Now, we do the third benchmark which is only for benchmarking of IO event performance. We take the benchmark method from http://libev.schmorp.de/bench.html.
The benchmark is very simple: first a number of socket pairs is created, then event watchers for those pairs are installed and then a (smaller) number of "active clients" send and receive data on a subset of those sockets.
The test code of evpp is at the source code benchmark/ioevent/evpp
. We use evpp::FdChannel
to implement this test program evpp_FdChannel and use evpp::PipeEventWatcher
to implement another test program evpp_PipeEventWatcher. We use tools/benchmark-build.sh
to compile it. The test script is run_ioevent_bench.sh, showing as below:
for num in 500 1000 10000 30000; do
for loop in 1 2 3 4 5 6 7 8 9 10; do
taskset -c 3 ../../build-release/bin/benchmark_ioevent_evpp_pipe_watcher -n $num -a 100 -w $num
taskset -c 3 ../../build-release/bin/benchmark_ioevent_evpp -n $num -a 100 -w $num
taskset -c 3 ../../build-release/bin/benchmark_ioevent_libevent -n $num -a 100 -w $num
done
done
The test code of asio is at https://github.com/huyuguang/asio_benchmark using commits 21fc1357d59644400e72a164627c1be5327fbe3d
and the test program socketpair.cpp. The test script is run_ioevent_bench.sh. It is:
for num in 500 1000 10000 30000; do
for loop in 1 2 3 4 5 6 7 8 9 10; do
echo "Bench index=$loop num=$num"
taskset -c 3 ./asio_test.exe socketpair $num 100 $num
done
done
For details, please see the charts below. The horizontal axis is the number of pipe count. The vertical axis is the time spent, the lower is the better.
The IO Event performance benchmark against Boost.Asio : evpp is higher than asio about 20%~50% in this case
The ping-pong benchmark against Boost.Asio : evpp is higher than asio about 5%~20% in this case
The throughput benchmark against libevent2 : evpp is higher than libevent about 17%~130% in this case
The performance benchmark of queue with std::mutex
against boost::lockfree::queue
and moodycamel::ConcurrentQueue
: moodycamel::ConcurrentQueue
is the best, the average is higher than boost::lockfree::queue
about 25%~100% and higher than queue with std::mutex
about 100%~500%
The throughput benchmark against Boost.Asio : evpp and asio have the similar performance in this case
The throughput benchmark against Boost.Asio(中文) : evpp and asio have the similar performance in this case
The throughput benchmark against muduo(中文) : evpp and muduo have the similar performance in this case
The beautiful chart is rendered by gochart. Thanks for your reading this report. Please feel free to discuss with us for the benchmark test.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。