-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rmeta: avoid embedding StabilityLevel::Unstable
reason multiple times into .rmeta\.rlib files
#98770
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
Or maybe encode with something like this, but values deduped? rust/compiler/rustc_metadata/src/rmeta/mod.rs Lines 126 to 135 in ca1e68b
|
There is precedent for such encoding, for instance |
from #88180 when issue was created:
|
Checked now, for stage0 compiler artifact libobject.rmeta: 11237 times, for example. |
Why not the following:
This would maximize the deduplication while being self-contained. What do you think? |
rust/compiler/rustc_span/src/symbol.rs Lines 1822 to 1833 in aedf78e
Something like replacing |
To generate those hash-tables, you can use specialization like we do for |
r? @cjgillot |
☔ The latest upstream changes (presumably #98975) made this pull request unmergeable. Please resolve the merge conflicts. |
I think this should be merged (and #98851 tested after that), as current default error message looks more like lint warn\error (that can possibly be translatable in future) and shouldn't be embed into compiled artifacts, will rebase. |
1cc712d
to
b38c948
Compare
@rustbot ready |
@bors r+ rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (7f93d4a): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Avoids bloating size of some rmeta\rlib files by not placing default string for
StabilityLevel::Unstable
reason multiple times, affects only stdlib\rustc artifacts. For stdlib cuts about 3% (diff of total size for patched\unpatched *.rmeta files of stage1-std) of file size, depending on crates.fixes #88180