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

增加hack包的基准测试方法,优化部分if-else代码,调整了限流部分令牌获取的顺序 #186

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

LampScript
Copy link
Contributor

1、在util包下新增了buffer_string_test.go文件,对比了hack.SliceToString和buffer.String性能差异。
2、在dispatcher.readyToReceiveWatchEvent方法中用switch替换了约10个if else判断。
3、在rateLimiter.do方法中调整了令牌获取顺序,优先从令牌桶中获取令牌,如果不足且策略选择为等待时再等待,否则拒绝。

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

Successfully merging this pull request may close these issues.

1 participant