diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-20 23:14:21 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-20 23:14:21 +0100 |
commit | 04d64267de2c9ade61ae9fdbc98114599c11a2d7 (patch) | |
tree | eb18414e177eb0e40e902c5ec45cebc49ac8d43b /crates/ra_ide_db | |
parent | 92fef01f6506b33c0489e020df1ad9fdce2fac9b (diff) | |
parent | a3c2f5126fb9f2575584d12335b6e7e82deec45a (diff) |
Merge #4947
4947: Replace `impls_in_trait` query with smarter use of `CrateImplDefs` r=matklad a=jonas-schievink
`impls_in_trait` was allocating a whopping ~400 MB of RAM when running analysis-stats on r-a itself.
Remove it, instead adding a query that computes a summary `CrateImplDefs` map for all transitive dependencies. This can probably still be made more efficient, but this already reduces the peak memory usage by 25% without much performance impact on analysis-stats.
**Before**:
```
Total: 34.962107188s, 2083mb allocated 2141mb resident
422mb ImplsForTraitQuery (deps)
250mb CrateDefMapQueryQuery
147mb MacroArgQuery
140mb TraitSolveQuery (deps)
68mb InferQueryQuery (deps)
62mb ImplDatumQuery (deps)
```
**After**:
```
Total: 35.261100358s, 1520mb allocated 1569mb resident
250mb CrateDefMapQueryQuery
147mb MacroArgQuery
144mb TraitSolveQuery (deps)
68mb InferQueryQuery (deps)
61mb ImplDatumQuery (deps)
45mb BodyQuery
45mb ImplDatumQuery
```
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r-- | crates/ra_ide_db/src/change.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_ide_db/src/change.rs b/crates/ra_ide_db/src/change.rs index 78ee6a515..98993d571 100644 --- a/crates/ra_ide_db/src/change.rs +++ b/crates/ra_ide_db/src/change.rs | |||
@@ -283,7 +283,7 @@ impl RootDatabase { | |||
283 | hir::db::GenericPredicatesQuery | 283 | hir::db::GenericPredicatesQuery |
284 | hir::db::GenericDefaultsQuery | 284 | hir::db::GenericDefaultsQuery |
285 | hir::db::ImplsInCrateQuery | 285 | hir::db::ImplsInCrateQuery |
286 | hir::db::ImplsForTraitQuery | 286 | hir::db::ImplsFromDepsQuery |
287 | hir::db::InternTypeCtorQuery | 287 | hir::db::InternTypeCtorQuery |
288 | hir::db::InternTypeParamIdQuery | 288 | hir::db::InternTypeParamIdQuery |
289 | hir::db::InternChalkImplQuery | 289 | hir::db::InternChalkImplQuery |