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: fix the the threshold check logic of WriteBinaryNocopy #20

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

YangruiEmma
Copy link
Member

@YangruiEmma YangruiEmma commented Sep 10, 2024

What type of PR is this?

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.

(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. #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,进而导致性能劣化。#20 已经修复。
触发场景:数据总包 > 4k,有很多小字符串的编码逻辑
影响点:CPU 上升且对延迟有显著影响

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

(optional) The PR that updates user documentation:

@xiaost xiaost merged commit 608357f into main Sep 10, 2024
22 checks passed
@xiaost xiaost deleted the online/WriteBinaryNocopy branch September 10, 2024 13:35
@YangruiEmma YangruiEmma changed the title fix: fix the the threshold check logic of WriteBinaryNocopy hotfix: fix the the threshold check logic of WriteBinaryNocopy Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants