-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.WG-compiler-performanceWorking group: Compiler PerformanceWorking group: Compiler Performance
Description
Computing the specialization graph for a trait involves looking at lots of things. The result of the query should be easily cacheable:
rust/src/librustc/traits/specialize/specialization_graph.rs
Lines 39 to 66 in e65547d
pub struct Graph { | |
// all impls have a parent; the "root" impls have as their parent the def_id | |
// of the trait | |
parent: DefIdMap<DefId>, | |
// the "root" impls are found by looking up the trait's def_id. | |
children: DefIdMap<Children>, | |
} | |
/// Children of a given impl, grouped into blanket/non-blanket varieties as is | |
/// done in `TraitDef`. | |
struct Children { | |
// Impls of a trait (or specializations of a given impl). To allow for | |
// quicker lookup, the impls are indexed by a simplified version of their | |
// `Self` type: impls with a simplifiable `Self` are stored in | |
// `nonblanket_impls` keyed by it, while all other impls are stored in | |
// `blanket_impls`. | |
// | |
// A similar division is used within `TraitDef`, but the lists there collect | |
// together *all* the impls for a trait, and are populated prior to building | |
// the specialization graph. | |
/// Impls of the trait. | |
nonblanket_impls: FxHashMap<fast_reject::SimplifiedType, Vec<DefId>>, | |
/// Blanket impls associated with the trait. | |
blanket_impls: Vec<DefId>, | |
} |
Metadata
Metadata
Assignees
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.WG-compiler-performanceWorking group: Compiler PerformanceWorking group: Compiler Performance