-
Notifications
You must be signed in to change notification settings - Fork 172
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
Use poll_recv_many for processing commands to be written to the nats server #1189
Conversation
88bda9c
to
46ffeda
Compare
That is really nice improvement @paolobarbolini ! |
From what I can gather from the latest releases it shouldn't take more than a few weeks. |
46ffeda
to
8b11a0b
Compare
Tokio v1.36 is out |
Ok it's not. Just a PR 😞 |
8b11a0b
to
0489470
Compare
0489470
to
45df788
Compare
Now it's out for real |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome to leverage this new API and gain 30% performance!
Thanks @paolobarbolini
Just some minor questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Tokio 1.36 exposed
Receiver::poll_recv_many
, which allows polling multiple items at once from an mpsc channel. Considering that our write buffer already has a lenient capacity limit, and the benchmarks show that the reduced overhead is worth it, this PR makes the connection handler poll 16 commands at once instead of just 1.Benchmark results (Ryzen 5900X)