Uh oh!
There was an error while loading. Please reload this page.
Add Read/Write::can_read/write_vectored - #67841
Conversation
rust-highfive
commented
Jan 3, 2020
r? @KodrAus (rust_highfive has picked a reviewer for you, use r? to override) |
sfackler
commented
Jan 3, 2020
cc @nikomatsakis this is part of what we talked about when discussing buffer initialization and vectored IO. |
There was a problem hiding this comment.
I'll fill in the issue assuming people are happy with this approach.
nagisa
commented
Jan 6, 2020
Why not just transparently merge the buffers? At this point the support for vectored I/O is becoming complicated enough that I think a broader discussion is worthwhile (i.e. an RFC). Also the name is not great. |
sfackler
commented
Jan 6, 2020
Because user code has more flexibility around how to merge those buffers.
Sure - definitely open to better naming. |
KodrAus
commented
Jan 6, 2020
This seems reasonable to me.
Perhaps something along the lines of the runtime CPU checks? let strategy = if writer.is_write_vectored_optimized(){WriteStrategy::Queue}else{WriteStrategy::Flatten};Also not a really great name, but the |
Dylan-DPC-zz
commented
Feb 20, 2020
@sfackler any updates? |
sfackler
commented
Feb 25, 2020
|
This comment has been minimized.
This comment has been minimized.
KodrAus
commented
Mar 11, 2020
I'd be on board with |
sfackler
commented
Mar 12, 2020
Renamed, and added a tracking issue |
rust-highfive
commented
Mar 12, 2020
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
bors
commented
Mar 17, 2020
☔ The latest upstream changes (presumably #70062) made this pull request unmergeable. Please resolve the merge conflicts. |
Dylan-DPC-zz
commented
Mar 30, 2020
@sfackler you have a merge commit. Can you unmerge it and rebase instead? thanks |
sfackler
commented
Mar 30, 2020
Fixed |
Dylan-DPC-zz
commented
Mar 31, 2020
@KodrAus this is ready for review |
bors
commented
Apr 4, 2020
☔ The latest upstream changes (presumably #70136) made this pull request unmergeable. Please resolve the merge conflicts. |
bors
commented
Apr 26, 2020
⌛ Testing commit 5d8fe1c with merge dd0bfd08f17cebeefea8fe2ae716edc78d3bd088... |
Dylan-DPC-zz
commented
Apr 26, 2020
@bors retry (yield) |
bors
commented
Apr 26, 2020
⌛ Testing commit 5d8fe1c with merge c2f3b75ad1ed2899a39346f3cfe57930fc8f914a... |
bors
commented
Apr 26, 2020
💔 Test failed - checks-azure |
sfackler
commented
Apr 26, 2020
@bors r=Amaneiu |
bors
commented
Apr 26, 2020
📌 Commit b00afb5 has been approved by |
bors
commented
Apr 27, 2020
⌛ Testing commit b00afb5 with merge 80ba2ba544868e6ae3dc83dd5c18cb6764c905da... |
bors
commented
Apr 27, 2020
💔 Test failed - checks-azure |
sfackler
commented
Apr 27, 2020
@bors r=Amaneiu |
bors
commented
Apr 27, 2020
📌 Commit c68f23f has been approved by |
Rollup of 7 pull requests Successful merges: - rust-lang#67841 (Add Read/Write::can_read/write_vectored) - rust-lang#71524 (Minimize parameter of coerce_borrowed_pointer()) - rust-lang#71558 (Cleanup and document `-Z tls-model` ) - rust-lang#71578 (linkchecker: fix typo in main.rs) - rust-lang#71596 (Fix broken link in `QPath` documentation) - rust-lang#71604 (make recursive-zst test unleashed) - rust-lang#71605 (No need to whitelist E0750 anymore) Failed merges: r? @ghost
When working with an arbitrary reader or writer, code that uses vectored
operations may end up being slower than code that copies into a single
buffer when the underlying reader or writer doesn't actually support
vectored operations. These new methods allow you to ask the reader or
witer up front if vectored operations are efficiently supported.
Currently, you have to use some heuristics to guess by e.g. checking if
the read or write only accessed the first buffer. Hyper is one concrete
example of a library that has to do this dynamically:
https://github.com/hyperium/hyper/blob/0eaf304644a396895a4ce1f0146e596640bb666a/src/proto/h1/io.rs#L582-L594