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: reduce allocations #588

Merged
merged 1 commit into from
Apr 15, 2020
Merged

feat: reduce allocations #588

merged 1 commit into from
Apr 15, 2020

Conversation

Stebalien
Copy link
Member

After profiling allocations on a bootstrap node, I've noticed that peerInfoToPBPeer is a very heavy source of allocations. This change should improve the situation significantly.

@Stebalien Stebalien requested a review from willscott April 15, 2020 21:32
pb/bytestring.go Outdated
}

func (b *byteString) MarshalTo(data []byte) (int, error) {
// intentionally using KeyString here to avoid allocating.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KeyString?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, copypasta from the cid version of this.

After profiling allocations on a bootstrap node, I've noticed that
peerInfoToPBPeer is a very heavy source of allocations. This change should
improve the situation significantly.
@Stebalien Stebalien force-pushed the feat/reduce-allocations branch from ff0153c to 68edc96 Compare April 15, 2020 21:37
@Stebalien Stebalien merged commit 260f979 into master Apr 15, 2020
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