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

dot/network: use sync.Pool for network message buffers #1576

Closed
noot opened this issue May 12, 2021 · 0 comments · Fixed by #1600
Closed

dot/network: use sync.Pool for network message buffers #1576

noot opened this issue May 12, 2021 · 0 comments · Fixed by #1600
Assignees

Comments

@noot
Copy link
Contributor

noot commented May 12, 2021

Task summary

  • currently in network.Service.readStream we allocate a buffer to read from the stream that the remote peer opened
  • however based on recent CPU profiling, the mallocing takes up a LOT of CPU (especially now that we handle the inbound stream properly)
  • we should use sync.Pool to allocate stream buffers instead, so we malloc a maxPeers number of buffers on node startup and then take/return them to the pool as needed

Other information and links

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 a pull request may close this issue.

2 participants