rust/compiler/rustc_incremental/src
Tyson Nottingham 52f21791fb 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.
2021-01-11 12:13:22 -08:00
..
persist Serialize incr comp structures to file via fixed-size buffer 2021-01-11 12:13:22 -08:00
assert_dep_graph.rs reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats) 2021-01-02 20:09:17 +01:00
assert_module_sources.rs Avoid reallocating cgu_path_components 2020-10-28 17:22:10 +01:00
lib.rs /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00