Skip to content

Optimize copies of large enums #54360

Open
@Manishearth

Description

@Manishearth

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationA-mir-optArea: MIR optimizationsC-enhancementCategory: An issue proposing an enhancement or a PR with one.C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchI-slowIssue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions