miri interpretation of large array initialization is slow #49199
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
A-mir-opt
Area: MIR optimizations
A-miri
Area: The miri tool
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-compiletime
Issue: Problems and improvements with respect to compile times.
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.
Right now, if you are initializing a large array either manually or with an array repeat expression takes a long time during interpretation.
Arrays with lots of fields that are initialized as
are turned into the MIR equivalent of
Which requires twice the memory (once for each variable and once for the array) and twice the instructions (initializing the variables and copying each variable into the array).
What do you think @eddyb ?
cc @Zoxc @bob_twinkles @rkruppe
The text was updated successfully, but these errors were encountered: