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 client buffers during serialization #775

Merged
merged 4 commits into from
Feb 20, 2020

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Feb 17, 2020

Before:

image

After:

image

The remaining allocations are related to Google.Protobuf creating/working with arrays. Once Google.Protobuf/Grpc.Tools supports buffers the remaining byte array allocations can be removed.

@@ -112,6 +113,9 @@ public override IBufferWriter<byte> GetBufferWriter()

private IBufferWriter<byte> ResolveBufferWriter()
{
// TODO(JamesNK): I believe length should be known by the context before the buffer writer is
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume we are going to explore this in a future PR. Let's file an issue for it to address all the potential improvements.

@JamesNK JamesNK force-pushed the jamesnk/client-serialization-buffers branch from 95df486 to 4fbabea Compare February 20, 2020 08:00
@JamesNK JamesNK merged commit 2cb89bf into grpc:master Feb 20, 2020
@JamesNK JamesNK deleted the jamesnk/client-serialization-buffers branch February 20, 2020 08:23
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