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

wire/common: Implement binarySerializer based on sync.Pool #1686

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kcalvinalvin
Copy link
Collaborator

sync.Pool implementation saves on the overhead of go channels and has the benefit of dynamically sizing the binaryFreeList.

sync.Pool is also used in the fmt package

@coveralls
Copy link

Pull Request Test Coverage Report for Build 530213972

  • 174 of 179 (97.21%) changed or added relevant lines in 3 files are covered.
  • 18 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.01%) to 53.412%

Changes Missing Coverage Covered Lines Changed/Added Lines %
wire/common.go 146 151 96.69%
Files with Coverage Reduction New Missed Lines %
wire/common.go 2 97.27%
btcec/signature.go 3 92.48%
peer/peer.go 13 75.24%
Totals Coverage Status
Change from base Build 512434868: 0.01%
Covered Lines: 20869
Relevant Lines: 39072

💛 - Coveralls

@cfromknecht
Copy link
Contributor

@kcalvinalvin this looks like it would be a nice companion to #1426. there will be some rebase conflicts but it'd be cool to see how much it improves the numbers in that PR.

@kcalvinalvin
Copy link
Collaborator Author

@kcalvinalvin this looks like it would be a nice companion to #1426. there will be some rebase conflicts but it'd be cool to see how much it improves the numbers in that PR.

I can rebase this PR on top of #1426. Would it be better to just make a PR to cfromknecht:wire-opts?

@BrannonKing
Copy link

A note on this: stack allocations would be faster than borrowing memory for all of the functions that return integers. There's no need to borrow anything on those.

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.

4 participants