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

feat: use sync.Pool to reduce alloc #729

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ethan256
Copy link

@ethan256 ethan256 commented Jun 6, 2024

use sync.Pool to reduce alloc on conn.Receive.

Signed-off-by: yuanliang <yuanliang_zh@163.com>
@kung-foo
Copy link
Member

Hi @ethan256, do you have some real-world motivation for wanting to introduce a pool?

@ethan256
Copy link
Author

ethan256 commented Jun 19, 2024

Hi @ethan256, do you have some real-world motivation for wanting to introduce a pool?
When I pressure tested it, I found that the program has a high GC percentage, and its pprof results are as follows:
image

Modified results:
image

Signed-off-by: yuanliang <yuanliang_zh@163.com>
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.

2 participants