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

Optimize GETting and object's payload #1040

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

paolobarbolini
Copy link
Contributor

@paolobarbolini paolobarbolini commented Jul 17, 2023

Removes a memcpy and an allocation from the object read implementation

Copy link
Collaborator

@caspervonb caspervonb left a comment

Choose a reason for hiding this comment

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

Was wondering if we could get away with having remaiing_bytes as a BytesMut buffer here.

@paolobarbolini
Copy link
Contributor Author

Was wondering if we could get away with having remaiing_bytes as a BytesMut buffer here.

It could work but if you don't need a Bytes at the end you're just wasting time with the ref-counting and all of the internal bytes machinery

Copy link
Collaborator

@caspervonb caspervonb left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

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

LGTM!

@Jarema Jarema merged commit 68ed49f into nats-io:main Jul 25, 2023
13 checks passed
@Jarema Jarema mentioned this pull request Sep 21, 2023
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.

3 participants