rust-analyzer/crates/ra_hir_ty/src
bors[bot] 04d64267de
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 <jonasschievink@gmail.com>
2020-06-20 22:14:21 +00:00
..
infer Push obligation instead of matching on solution 2020-06-20 17:00:57 +02:00
tests Merge #4958 2020-06-20 15:10:35 +00:00
traits Merge #4947 2020-06-20 22:14:21 +00:00
_match.rs Avoid all unchecked indexing in match checking 2020-06-17 21:41:07 +02:00
autoderef.rs Switch Chalk to recursive solver 2020-04-16 13:06:23 +02:00
db.rs Replace impls_in_trait with CrateImplDefs 2020-06-19 01:29:34 +02:00
diagnostics.rs Add quickfix to add a struct field 2020-06-12 18:52:44 +02:00
display.rs Review fixes 2020-06-05 17:41:58 +02:00
expr.rs Make known paths use core instead of std 2020-06-11 16:23:20 +02:00
infer.rs Make known paths use core instead of std 2020-06-11 16:23:20 +02:00
lib.rs Apply suggestions from code review 2020-06-18 10:15:43 +03:00
lower.rs Shift bound variables correctly when using assoc type shorthand 2020-06-19 22:07:58 +02:00
method_resolution.rs Recursively compute impl sets 2020-06-20 00:36:02 +02:00
op.rs infer: Make expected rhs type for plain assign the lhs type 2020-05-10 16:24:04 +02:00
primitive.rs Clean up handling of int/float literal types 2020-06-06 17:52:00 +02:00
test_db.rs Make relevant_crates return a Set 2020-06-11 11:30:06 +02:00
tests.rs Merge #4175 2020-05-09 09:29:11 +00:00
traits.rs Merge #4947 2020-06-20 22:14:21 +00:00
utils.rs Use correct substs for super trait assoc types 2020-06-19 21:46:47 +02:00