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

add chunking in poll_write? #128

Open
rkuhn opened this issue Feb 4, 2022 · 1 comment
Open

add chunking in poll_write? #128

rkuhn opened this issue Feb 4, 2022 · 1 comment

Comments

@rkuhn
Copy link

rkuhn commented Feb 4, 2022

Since there is poll_flush for triggering a send syscall (which I consider to be expensive), how about buffering data in poll_write up to the chunking threshold?

As an example, the protocol I’m currently working on alternates between writing 4 bytes and some kB. While debugging some issues I saw that the 4 bytes were sent over the wire with a 12 byte header. In my send loop I deliberately call poll_write for as long as I have data, followed by poll_flush and then waiting for more inputs. With some chunking this would probably increase bandwidth by a large factor.

I know from testing that mplex requires flushing, but since yamux currently does not (which I don’t think is documented) we’d probably need to review all protocols for proper use of poll_flush after such a change.

@mxinden
Copy link
Member

mxinden commented Feb 7, 2022

Off the top of my head, this makes sense to me. While we have optimized this implementation for large payloads (see e.g. #100), we have not done so for small messages.

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

No branches or pull requests

2 participants