-
Notifications
You must be signed in to change notification settings - Fork 396
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
support custom protobuf serializer for logGroup to improve send performance #1845
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
henryzhx8
commented
Oct 31, 2024
•
edited
Loading
edited
- 背景:在序列化event group时,需要首先转成logGroup的pb,然后再将pb序列化成string,这里至少经历了两次字符串复制,还不考虑中间夹杂的内存重新分配,整体效率很差。对于极简单行场景,有60%的时间都在执行序列化的操作,影响发送效率。
- 方案:根据根据protobuf的协议 ,直接手写序列化函数,即直接将event group直接变成string即直接将eventgroup直接变成string,这样只需要一次字符串拷贝即可,进一步的,可事先计算序列化后的字符串大小,提前分配内存,避免中间额外的内存分配。
yyuuttaaoo
changed the title
support custom protobuf serializer for logGroup to improve performance
improve sls send performance
Oct 31, 2024
henryzhx8
changed the title
improve sls send performance
support custom protobuf serializer for logGroup to improve send performance
Nov 1, 2024
messixukejia
previously requested changes
Nov 2, 2024
yyuuttaaoo
reviewed
Nov 4, 2024
yyuuttaaoo
approved these changes
Nov 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.