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 performance benchmark of
queue with std::mutex against
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 beautiful chart is rendered by gochart. Thanks for your reading this report. Please feel free to discuss with us for the benchmark test.
：Code submit frequency
：React/respond to issue & PR etc.
：Well-balanced team members and collaboration
：Recent popularity of project
：Star counts, download counts etc.