Big static array causes rlib to bloat in size #136519
Labels
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
A big static array inside a library causes the generated lib file to bloat in size, even if it is zero initialized.
I tried this code:
I would expect that this would not affect the size of library.
Instead this causes the library to include a LOT of 0s, increasing the size in this example to over 1GB.
The final executeable is unaffected, only the .rlib file bloats.
Meta
This happens in stable and nightly
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: