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

Protobuf scalar default values and ByteString detail #19769

Merged
merged 1 commit into from Sep 16, 2020

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Sep 3, 2020

Fixes #19760

@jskeet

@davidfowl
Copy link
Member

Performance warning: this copy copies byte[] how many times?

@JamesNK
Copy link
Member Author

JamesNK commented Sep 3, 2020

ByteString.CopyBytes and BytesString.ToByteArray are an allocation plus copy.

For reading values, Memory/Span properties exist. For creating values there is discussion about adding an unsafe API - protocolbuffers/protobuf#7645

If it does get added I don't think it is appropriate to talk about in this doc, since it is a general usage guide. The performance guide would be a better place to discuss how to be efficient when sending byte payloads with gRPC.

Copy link

@jskeet jskeet left a comment

Choose a reason for hiding this comment

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

LGTM - thanks James.

@JamesNK JamesNK merged commit 905252c into master Sep 16, 2020
@JamesNK JamesNK deleted the jamesnk/protobuf-feedback branch September 16, 2020 23:17
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.

Add detail about string and ByteString
3 participants