mirror of
https://github.com/skywind3000/kcp.git
synced 2025-03-23 16:00:08 +08:00
Created KCP Benchmark (markdown)
parent
5d16ad79e8
commit
e23c786bb1
28
KCP-Benchmark.md
Normal file
28
KCP-Benchmark.md
Normal file
@ -0,0 +1,28 @@
|
||||
如果网络从来不丢包,那么你直接用 TCP就行了,甚至直接裸UDP都没关系,但是网络因为丢包造成卡顿,特别是高峰时期丢包会上到10%的情况,移动设备上这个情况更糟糕。
|
||||
|
||||
我自己评测过很多,[asio_kcp](https://github.com/libinzhangyuan/asio_kcp) 的作者做过比较详细的评测,在网络变糟糕的情况下,KCP的延迟比 libenet低三倍以上:
|
||||
|
||||
`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`
|
||||
|
||||
更详细的评测可以看这里:[benchmark](https://github.com/libinzhangyuan/reliable_udp_bench_mark/blob/master/bench_mark.md),感谢 asio_kcp 的作者 zhangyuan 详细对比了 UDT, libenet和 kcp,并给出结论如下:
|
||||
|
||||
* 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.
|
||||
|
||||
其他可以左右你选择的情况:
|
||||
|
||||
* 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.
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user