Experiment with sharing monomorphized code between crates #47317
Labels
A-codegen
Area: Code generation
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
I-compilemem
Issue: Problems and improvements with respect to memory usage during compilation.
I-compiletime
Issue: Problems and improvements with respect to compile times.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
WG-compiler-performance
Working group: Compiler Performance
At the moment the compiler will re-instantiate generic code in every crate that uses it. That sounds like a lot of duplicated work. However, we don't have any actual numbers on how much duplicated work. There are a few things we could do:
This could potentially be a big win for compile times but we won't know until we've collected some data.
Side node: Sharing monomorphized instances could negatively affect runtime performance when compiling without any form of LTO or when compiling with ThinLTO just for the current crate (as opposed to doing ThinLTO over the whole crate graph).
The text was updated successfully, but these errors were encountered: