about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-01-12 05:51:40 +0000
committerbors <bors@rust-lang.org>2021-01-12 05:51:40 +0000
commit8234db5bc7b122dd9e39d738c30bcae005a96568 (patch)
tree72cc8e80644034c7e81dfa22577e83583cd6c46a /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent467f5e99a541db94235f0c173bdffc8aeb177522 (diff)
parentf15fae822e3b1d2218699976219aecc26187dc9a (diff)
downloadrust-8234db5bc7b122dd9e39d738c30bcae005a96568.tar.gz
rust-8234db5bc7b122dd9e39d738c30bcae005a96568.zip
Auto merge of #80463 - tgnottingham:incr_comp_serial_mem_usage, r=oli-obk
Serialize incr comp structures to file via fixed-size buffer

Reduce a large memory spike that happens during serialization by writing
the incr comp structures to file by way of a fixed-size buffer, rather
than an unbounded vector.

Effort was made to keep the instruction count close to that of the
previous implementation. However, buffered writing to a file inherently
has more overhead than writing to a vector, because each write may
result in a handleable error. To reduce this overhead, arrangements are
made so that each LEB128-encoded integer can be written to the buffer
with only one capacity and error check. Higher-level optimizations in
which entire composite structures can be written with one capacity and
error check are possible, but would require much more work.

The performance is mostly on par with the previous implementation, with
small to moderate instruction count regressions. The memory reduction is
significant, however, so it seems like a worth-while trade-off.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions