Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于gokcp的性能相关的疑惑 #1

Open
junbrave1 opened this issue Apr 21, 2020 · 4 comments
Open

关于gokcp的性能相关的疑惑 #1

junbrave1 opened this issue Apr 21, 2020 · 4 comments

Comments

@junbrave1
Copy link

请问gokcp在如下方面表现如何?

  1. 与传统TCP比的速度有无提升
  2. 在网络较差的情况下的速度能达到多少
@shaoyuan1943
Copy link
Owner

整体比TCP快30%-40%的传输速度,但同时带来10~20%的带宽浪费

@zhengying
Copy link

整体比TCP快30%-40%的传输速度,但同时带来10~20%的带宽浪费

请问和c版的kcp,性能和内存占用有多大差别?

@shaoyuan1943
Copy link
Owner

@zhengying 内存占用上根据实际场景而有所不同,我测试了一些典型场景,比如RPG游戏、下载、视频,在这些场景下和原版C实现的KCP相比,内存占用会比原版少,但不会少太多,在个位数值左右。至于性能的话,定性也很多,比如你设置的nodelay模式参数,你滑动窗口大小等,还与你上层是如何实现的也有一定关系。有一点需要明白,KCP仅仅只是算法实现,它的运行需要基于你的上层网络实现,在没有明显bug的情况下,各个语言的实现在性能上都相差不会太大。

在我自己实现的一个简单udp会话管理框架上,多核情况下性能还是非常不错的,如果你是单核心的话,其实与原版性能相差不大。

@zhengying
Copy link

谢谢,看了下代码,感觉很不错!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants