Code generation issue blocks the removal of an unused struct field #77058
Labels
A-codegen
Area: Code generation
C-bug
Category: This is a bug.
I-compiletime
Issue: Problems and improvements with respect to compile times.
The
unused_field
field of typeOption<DefId>
inParamEnv
is not used but removing the field has a strange and undesired effect on compiler performance.When the field is removed, performance changes as in #74865 are observed: an instruction count gain of about 1% across all tests, with the unicode_* tests demonstrating a 3% increase, even though, in principle, less work should be done if the unused field is not copied around. Worse, the 3% instruction count increase corresponds to a 25% percent increase in wall-time, moreover suggesting that something is going wrong.
Interestingly, changing the type of
Option<DefId>
, which is 8 bytes long, with an unused field of type[u8; 8]
, has a performance impact. The conversation at #76913 contains several perf runs that are relevant.Once the code generation issue is resolved and the field is removed, a performance gain of about 1% is expected to be realized.
The text was updated successfully, but these errors were encountered: