Updated EN_KCP Benchmark (markdown)

winlin 2017-02-17 10:36:14 +08:00
parent 3da380e793
commit 01c09c2914

@ -1,8 +1,8 @@
# Benchmark # Benchmark
如果网络从来不丢包,那么你直接用 TCP就行了甚至直接裸UDP都没关系但是网络因为丢包造成卡顿特别是高峰时期丢包会上到10%的情况,移动设备上这个情况更糟糕。 TCP is good enough when network is not heavy. But the experience is worse when packet is dropped for heavy network, for instance 10% packets dropped.
我自己评测过很多,[asio_kcp](https://github.com/libinzhangyuan/asio_kcp) 的作者做过比较详细的评测在网络变糟糕的情况下KCP的延迟比 libenet低三倍以上 I've done some benchmark. There is a detail benchmark [asio_kcp](https://github.com/libinzhangyuan/asio_kcp) for heavy network, which indicates the latency of KCP is 1/3 of `libenet`:
```cpp ```cpp
worst network lag happen: worst network lag happen:
@ -13,7 +13,7 @@ enet: 10:51.21
1563 1520 1470 1482 1438 1454 1412 1637 1588 1540 1563 1520 1470 1482 1438 1454 1412 1637 1588 1540
``` ```
更详细的评测可以看这里:[benchmark](https://github.com/libinzhangyuan/reliable_udp_bench_mark/blob/master/bench_mark.md),感谢 asio_kcp 的作者 zhangyuan 详细对比了 UDT, libenet和 kcp并给出结论如下 The detail data is here [benchmark](https://github.com/libinzhangyuan/reliable_udp_bench_mark/blob/master/bench_mark.md). Thanks the owner of `asio_kcp` `zhangyuan` to compare UDT, libenet and KCP:
* ASIO-KCP has good performace in wifi and phone network(3G, 4G). * ASIO-KCP has good performace in wifi and phone network(3G, 4G).
* The kcp is the first choice for realtime pvp game. * The kcp is the first choice for realtime pvp game.
@ -21,7 +21,7 @@ enet: 10:51.21
* The enet is a good choice if your game allow 2 second lag. * The enet is a good choice if your game allow 2 second lag.
* UDT is a bad idea. It always sink into badly situation of more than serval seconds lag. And the recovery is not expected. * UDT is a bad idea. It always sink into badly situation of more than serval seconds lag. And the recovery is not expected.
其他可以左右你选择的情况: And more:
* enet has the problem of lack of doc. And it has lots of functions that you may intrest. * enet has the problem of lack of doc. And it has lots of functions that you may intrest.
* kcp's doc is chinese. * kcp's doc is chinese.
@ -29,5 +29,5 @@ enet: 10:51.21
* The kcp is a simple thing. You will write more code if you want more feature. * The kcp is a simple thing. You will write more code if you want more feature.
* UDT has a perfect doc. UDT may has more bug than others as I feeling. * UDT has a perfect doc. UDT may has more bug than others as I feeling.
我当年主要测试了 KCP和 TCP/UDT的比较扫了一眼 libenet觉得协议实现中规中矩缺乏很多现代传输协议的技术所以并没有详细测试。而 asio-kcp的作者同时给出了KCP/enet/udt三者的详细比较为犹豫选择的人提供了更多指引。 I just compare the KCP with TCP/UDT, for I think `libenet` does not introduce modern transport techniques. The benchmark from owner of `asio-kcp` shows the difference of KCP/enet/UDT.