Allow using uncompressed metadata for proc-macros and dylibs #77602
Labels
A-metadata
Area: Crate metadata
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Currently, we always compress crate metadata for dylibs and proc-macros:
rust/compiler/rustc_interface/src/passes.rs
Lines 928 to 940 in ea7e131
This prevents us from
mmap
-ing the metadata into memory when we decode it, since we need to read the entire file in order to decompress it.We should allow configuring this setting via a
-Z
flag (and maybe through theCargo.toml
at some point), to allow users to trade disk space for speed. In addition to avoiding the overhead of compressing/decompressing, gaining the ability tommap
the crate metadata means that we may avoid loading unused portions from disk entirely. This is less important for proc-macros after #76897, but might still have a noticable performance impact for dylibs.Suggested by @joshtriplett on Zulip.
The text was updated successfully, but these errors were encountered: