mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-22 21:44:44 +00:00
2c56ea38b0
Use is_write_vectored to optimize the write_vectored implementation for BufWriter In case when the underlying writer does not have an efficient implementation `write_vectored`, the present implementation of `write_vectored` for `BufWriter` may still forward vectored writes directly to the writer depending on the total length of the data. This misses the advantage of buffering, as the actually written slice may be small. Provide an alternative code path for the non-vectored case, where the slices passed to `BufWriter` are coalesced in the buffer before being flushed to the underlying writer with plain `write` calls. The buffer is only bypassed if an individual slice's length is at least as large as the buffer. Remove a FIXME comment referring to #72919 as the issue has been closed with an explanation provided. |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml |