diff --git a/README.md b/README.md index 2c9bd08..30f0c4d 100644 --- a/README.md +++ b/README.md @@ -120,15 +120,43 @@ TCP是为流量设计的(每秒内可以传输多少KB的数据),讲究的 - [KCP 最佳实践](https://github.com/skywind3000/kcp/wiki/KCP-Best-Practice) - [同现有TCP服务器集成](https://github.com/skywind3000/kcp/wiki/Cooperate-With-Tcp-Server) - [传输数据加密](https://github.com/skywind3000/kcp/wiki/Network-Encryption) -- [应用层流量控制](https://github.com/skywind3000/kcp/wiki/Flow-Control-for-Users) - +- [应用层流量控制](https://github.com/skywind3000/kcp/wiki/Flow-Control-for-Users) +- [性能评测](https://github.com/skywind3000/kcp/wiki/KCP-Benchmark) # 相关应用 - - [dog-tunnel](https://github.com/vzex/dog-tunnel): GO开发的网络隧道,使用 KCP极大的改进了传输速度,并移植了一份 GO版本 KCP -- [lua-kcp](https://github.com/linxiaolong/lua-kcp):KCP的 Lua扩展,用于 Lua服务器 +- [lua-kcp](https://github.com/linxiaolong/lua-kcp):KCP的 Lua扩展,用于 Lua服务器 +- [asio-kcp](https://github.com/libinzhangyuan/asio_kcp): 使用 KCP的完整 UDP网络库,完整实现了基于 UDP的链接状态管理,会话控制,KCP协议调度等,可直接使用的用户库。 +# 性能比较 + +感谢 [asio-kcp](https://github.com/libinzhangyuan/asio_kcp) 的作者 [zhangyuan](https://github.com/libinzhangyuan) 对 KCP 与 enet, udt做过的一次横向评测,结论如下: + +- The kcp is the first choice for realtime pvp game. +- The lag is less than 1 second when network lag happen. 3 times better than enet when lag happen. +- 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. +- Has good performace in wifi and phone network(3G, 4G). +- Extra using 20% ~ 50% network flow for speed improvement. +- enet has the problem of lack of doc. And it has lots of functions that you may intrest. +kcp's doc is chinese. +Good thing is the function detail which is writen in code is english. And you can use asio_kcp which is a good wrap. +- 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. + +具体见:[横向比较](https://github.com/libinzhangyuan/reliable_udp_bench_mark/blob/master/bench_mark.md) 和 [这里](https://github.com/skywind3000/kcp/wiki/KCP-Benchmark)。截取一段在网络糟糕时,asio-kcp/enet的延迟数据: + +```cpp +worst network lag happen: +asio: 10:51.21 +291 295 269 268 231 195 249 230 225 204 + +enet: 10:51.21 +1563 1520 1470 1482 1438 1454 1412 1637 1588 1540 +``` + +我当年主要测试了 KCP和 TCP/UDT的比较,扫了一眼 libenet觉得协议实现中规中矩,缺乏很多现代传输协议的技术,所以并没有详细测试。而 asio-kcp的作者同时给出了KCP/enet/udt三者的详细比较,为更多犹豫选择使用那一套的人提供了更多指引。 # 欢迎捐赠