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

Write unary content with single Stream.WriteAsync #901

Merged
merged 3 commits into from
May 12, 2020

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented May 11, 2020

Large performance improvement in unary RPS.

dotnet/runtime#35184 (comment)

Before

Successfully processed 100373; RPS 27299; Errors 0; Last elapsed 3.9209ms
Successfully processed 127896; RPS 27496; Errors 0; Last elapsed 3.6429ms
Successfully processed 155281; RPS 27374; Errors 0; Last elapsed 3.6593ms
Successfully processed 182801; RPS 27520; Errors 0; Last elapsed 3.546ms
Successfully processed 209917; RPS 27112; Errors 0; Last elapsed 3.6468ms

After

Successfully processed 228755; RPS 52340; Errors 0; Last elapsed 2.1993ms
Successfully processed 282848; RPS 53993; Errors 0; Last elapsed 2.1865ms
Successfully processed 336652; RPS 53802; Errors 0; Last elapsed 1.5827ms
Successfully processed 390310; RPS 53628; Errors 0; Last elapsed 0.9105ms
Successfully processed 443199; RPS 52889; Errors 0; Last elapsed 2.2438ms

When Google.Protobuf supports writing to IBufferWriter<byte> this can be improved to write message data directly to the buffer array.

@stephentoub

Copy link
Contributor

@JunTaoLuo JunTaoLuo left a comment

Choose a reason for hiding this comment

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

Impressive improvements!

@JamesNK JamesNK merged commit 41618a4 into grpc:master May 12, 2020
@JamesNK JamesNK deleted the jamesnk/http2-send-perf branch May 12, 2020 21:17
@maxbl4
Copy link

maxbl4 commented Jun 4, 2020

Do I understand correctly: these improvement can only be seen on net 5.0 runtime?
I ran some tests with grpc.net 2.27 on 3.1.300, grpc.net 2.29 on 3.1.300 and
grpc.net 2.29 on 5.0.100-preview.7.20304.1-win-x64
and see perf improvement only on net 5.0

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