diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-08 22:11:53 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-08 22:11:53 +0100 |
commit | a75763cd57ac6d9cd08846770b8c5f5ba27122df (patch) | |
tree | d33b6ca6fc37c3eaf19980926fa2dd0d59e66b43 /crates/hir_ty/src/lib.rs | |
parent | 63726a91b721e119622e0c7ea106fc5c2e866bf3 (diff) | |
parent | 37ff15ad835ee4ba6d231cac8b1adbd301aec20b (diff) |
Merge #8433
8433: Intern lots of things r=jonas-schievink a=flodiebold
This uses the new interning infrastructure for most type-related things, where it had a positive effect on memory usage and performance. In total, this gives a slight performance improvement and a quite good memory reduction (1119MB->885MB on RA, 1774MB->1188MB on Diesel).
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r-- | crates/hir_ty/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index 874c95411..beb58d711 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs | |||
@@ -109,7 +109,7 @@ pub type WhereClause = chalk_ir::WhereClause<Interner>; | |||
109 | pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution { | 109 | pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution { |
110 | Substitution::from_iter( | 110 | Substitution::from_iter( |
111 | &Interner, | 111 | &Interner, |
112 | s.interned()[..std::cmp::min(s.len(&Interner), n)].iter().cloned(), | 112 | s.as_slice(&Interner)[..std::cmp::min(s.len(&Interner), n)].iter().cloned(), |
113 | ) | 113 | ) |
114 | } | 114 | } |
115 | 115 | ||
@@ -187,7 +187,7 @@ impl CallableSig { | |||
187 | .shifted_out_to(&Interner, DebruijnIndex::ONE) | 187 | .shifted_out_to(&Interner, DebruijnIndex::ONE) |
188 | .expect("unexpected lifetime vars in fn ptr") | 188 | .expect("unexpected lifetime vars in fn ptr") |
189 | .0 | 189 | .0 |
190 | .interned() | 190 | .as_slice(&Interner) |
191 | .iter() | 191 | .iter() |
192 | .map(|arg| arg.assert_ty_ref(&Interner).clone()) | 192 | .map(|arg| arg.assert_ty_ref(&Interner).clone()) |
193 | .collect(), | 193 | .collect(), |