-
-
Notifications
You must be signed in to change notification settings - Fork 396
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
#729: proto: write outgoing packets to caller-supplied memory #1697
Conversation
- buffer as argument - Proto transmit struct has size of the payload instead of buffer
534051f
to
b7830c5
Compare
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 seems pretty nice! Have you measured the performance impact?
- use quinn-proto to get buffer size - remove unnecessary includes - revert Transmit varibles order
I've not forgotten about the perf. I will share the comparison later 👍 |
I'd be surprised if there was a significant performance improvement from this alone, but it brings us much closer to being able to reuse transmit buffers (perhaps by doing UDP transmits directly from connection tasks), which is more likely to have a direct impact. Still, always good to check for the impact of changes on the I/O path. |
I've ran poll_transmit_pre_alloc latest main If this is not enough please give me some pointers and I will try to do an analysis that fits the project. |
@djc I've decided to expose the mtu from the connection. |
So this shows as a ~18% regression for |
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.
Exposing the MTU makes sense to me; other quinn-proto users will want it for the same reason.
@lmpn I'm having some difficulty reading your chart screenshot. Are the 4 aggregated figures for each separate test, in order? So there's a 20% speedup in We should be able to get identical performance to |
- rename get_current_mtu to current_mtu - add proper docstring to current_mtu
Thanks for the detailed analysis! To summarize: apparent massive speedup for I think this nets out as a win as written, personally. I've experimented on a couple of my machines (both Windows and Linux) and wasn't able to show a significant difference either way. |
@lmpn was this motivated by Hacktoberfest, and if so, is there a merge deadline to make this count for your stats? |
No... |
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.
Thanks!
My environment still registers too much noise to get meaningful data, but it's exciting that it had such an impact in yours! Maybe the impact is larger on Windows, where GSO isn't doing as much heavy lifting. |
I've used
BytesMut
for convenience but I can change to&mut [u8]
.