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

Re-enable vectored writes #2320

Closed
seanmonstar opened this issue Nov 6, 2020 · 3 comments
Closed

Re-enable vectored writes #2320

seanmonstar opened this issue Nov 6, 2020 · 3 comments
Labels
C-performance Category: performance. This is making existing behavior go faster.
Milestone

Comments

@seanmonstar
Copy link
Member

Tokio 0.3 removed an API to do vectored writes. During the upgrade, hyper disabled its support, but we should try to re-enable before releasing 0.14.

This requires a proposal for a new API in Tokio proper.

@seanmonstar seanmonstar added C-performance Category: performance. This is making existing behavior go faster. B-upstream Blocked: needs a change in a dependency or the compiler. labels Nov 6, 2020
@seanmonstar seanmonstar added this to the 0.14 milestone Nov 6, 2020
@seanmonstar
Copy link
Member Author

Proposal in Tokio: tokio-rs/tokio#3135

@bikeshedder
Copy link

tokio-rs/tokio#3149 has been merged and tokio 0.3.4 was released 2 days ago which includes this feature. 🎉

@seanmonstar
Copy link
Member Author

It's being worked on in #2338 :D

@seanmonstar seanmonstar removed the B-upstream Blocked: needs a change in a dependency or the compiler. label Nov 24, 2020
BenxiangGe pushed a commit to BenxiangGe/hyper that referenced this issue Jul 26, 2021
Tokio's `AsyncWrite` trait once again has support for vectored writes in
Tokio 0.3.4 (see tokio-rs/tokio#3149).

This branch re-enables vectored writes in Hyper for HTTP/1. Using
vectored writes in HTTP/2 will require an upstream change in the `h2`
crate as well.

I've removed the adaptive write buffer implementation
that attempts to detect whether vectored IO is or is not available,
since the Tokio 0.3.4 `AsyncWrite` trait exposes this directly via the
`is_write_vectored` method. Now, we just ask the IO whether or not it
supports vectored writes, and configure the buffer accordingly. This
makes the implementation somewhat simpler.

This also removes `http1_writev()` methods from the builders. These are
no longer necessary, as Hyper can now determine whether or not
to use vectored writes based on `is_write_vectored`, rather than trying
to auto-detect it.

Closes hyperium#2320 

BREAKING CHANGE: Removed `http1_writev` methods from `client::Builder`,
  `client::conn::Builder`, `server::Builder`, and `server::conn::Builder`.
  
  Vectored writes are now enabled based on whether the `AsyncWrite`
  implementation in use supports them, rather than though adaptive
  detection. To explicitly disable vectored writes, users may wrap the IO
  in a newtype that implements `AsyncRead` and `AsyncWrite` and returns
  `false` from its `AsyncWrite::is_write_vectored` method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-performance Category: performance. This is making existing behavior go faster.
Projects
None yet
Development

No branches or pull requests

2 participants