Binary size impact of enabling -Zshare-generics for opt-level=z #142164
Labels
C-discussion
Category: Discussion or questions that doesn't represent real issues.
E-needs-investigation
Call for partcipation: This issues needs some investigation to determine current status
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.
Uh oh!
There was an error while loading. Please reload this page.
opt-level=z and opt-level=s implicitly enable
-Zshare-generics
. While this can have positive binary size impacts, it can also have negative binary size impacts because it reduces LLVMs ability to inline functions.I have done some analysis on a bunch of projects, comparing the output from
size
for different opt levels.Script
I got the following results:
Results CSV
Results Table
It looks like -Zshare-generics is sometimes an improvement and sometimes a regression. It is not immediately clear to me whether enabling it as currently is the right tradeoff of whether it would make more sense to disable it by default.
The text was updated successfully, but these errors were encountered: