Skip to content

optimize alloc hot spot#737

Closed
brianolson wants to merge 1 commit intomainfrom
bolson/less-gc
Closed

optimize alloc hot spot#737
brianolson wants to merge 1 commit intomainfrom
bolson/less-gc

Conversation

@brianolson
Copy link
Contributor

15% of alloc are NewCborWriter() inside MarshalCBOR() in BGS.EventHandler(), cut half of them

@brianolson
Copy link
Contributor Author

TODO: also update to cbor-gen that makes fewer alloc whyrusleeping/cbor-gen#104

}

if err := header.MarshalCBOR(wc); err != nil {
cborWriter := cbg.NewCborWriter(wc)
Copy link
Collaborator

Choose a reason for hiding this comment

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

move this outside of the loop and use SetWriter

@brianolson
Copy link
Contributor Author

do #738 instead

@brianolson brianolson closed this Sep 4, 2024
@brianolson brianolson deleted the bolson/less-gc branch September 5, 2024 17:47
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