Optimize copies of large enums #54360
Labels
A-codegen
Area: Code generation
A-mir-opt
Area: MIR optimizations
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
For types like
SmallVec<[T; 1000]>
, or in general an enum where the variants have a huge difference in size, we should probably try to optimize the copies better.Basically, for enums with some large-enough difference between variant sizes, we should use a branch when codegenning copies/moves.
I'm not sure how common this pattern is, but it's worth looking into!
cc @rust-lang/wg-codegen
The text was updated successfully, but these errors were encountered: