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

hotfix: upgrade cloudwego/gopkg to fix WriteBinaryNocopy #1539

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

YangruiEmma
Copy link
Member

@YangruiEmma YangruiEmma commented Sep 10, 2024

What type of PR is this?

hotfix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

hotfix: 升级 cloudwego/gopkg 修复 WriteBinaryNocopy 逻辑

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
Kitex v0.11.0 has added a dependency on github.com/cloudwego/gopkg, and the thrift encoding logic has also been migrated to github.com/cloudwego/gopkg. However, the migrated code introduces a bug in the modification of WriteBinaryNocopy, resulting in all string/[]byte encodings executing WriteDirect after the total package exceeds 4k, leading to performance degradation. cloudwego/gopkg# 20 has been fixed.
Trigger scenario: Data package>4k, with many encoding logics for small strings
Impact point: CPU increases and has a significant impact on latency

zh(optional):
kitex v0.11.0 新增 github.com/cloudwego/gopkg 依赖,同时 thrift 编码逻辑也迁移至 github.com/cloudwego/gopkg,但迁移后的代码对 WriteBinaryNocopy 的修改引入了 bug,导致数据总包超过 4k 后,所有字符串/[]byte编码都会执行 WriteDirect,进而导致性能劣化。cloudwego/gopkg# 20 已经修复。
触发场景:数据总包 > 4k,有很多小字符串的编码逻辑
影响点:CPU 上升且对延迟有显著影响

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

Sorry, something went wrong.

@YangruiEmma YangruiEmma requested review from a team as code owners September 10, 2024 14:49
@YangruiEmma YangruiEmma added the hotfix This pr is a hotfix. label Sep 10, 2024
@ppzqh ppzqh merged commit c5acf5e into main Sep 11, 2024
36 checks passed
@ppzqh ppzqh deleted the hotfix/WriteBinaryNocopy branch September 11, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotfix This pr is a hotfix.
Development

Successfully merging this pull request may close these issues.

None yet

3 participants