about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-09 01:54:08 +0000
committerbors <bors@rust-lang.org>2020-12-09 01:54:08 +0000
commit2c56ea38b045624dc8b42ec948fc169eaff1206a (patch)
tree67ec5a273fbd423069e9e616e0f2dbc46a91bfde /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parent1700ca07c6dd7becff85678409a5df6ad4cf4f47 (diff)
parent674dd623ee067d4298fda867f72442b13014eaa3 (diff)
downloadrust-2c56ea38b045624dc8b42ec948fc169eaff1206a.tar.gz
rust-2c56ea38b045624dc8b42ec948fc169eaff1206a.zip
Auto merge of #78768 - mzabaluev:optimize-buf-writer, r=cramertj
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.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions