Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upcache the results of type projection and normalization #20304
Comments
nikomatsakis
added
A-associated-items
C-cleanup
I-compiletime
labels
Jan 7, 2015
nikomatsakis
referenced this issue
Jan 27, 2015
Closed
Major regression in type checking performance compiling rustdoc #21694
This comment has been minimized.
This comment has been minimized.
|
cc me |
This comment has been minimized.
This comment has been minimized.
|
cc me (this seems to take 10% of no-opt time). |
jonas-schievink
referenced this issue
Oct 11, 2015
Closed
Where clauses increase compilation time and memory use dramatically. #26325
This comment has been minimized.
This comment has been minimized.
|
Which functions in the compiler need to be memoized? |
This comment has been minimized.
This comment has been minimized.
Marwes
referenced this issue
Mar 5, 2016
Merged
Improve time complexity of equality relations #32062
This comment has been minimized.
This comment has been minimized.
|
I was thinking about implementing this but I have run into some trouble. From what I can gather it is possible for type inference to try multiple different alternatives before it finds the correct typing. This means that types returned after normalizing and selecting associated types may actually be wrong and thus cannot be cached. Is there some way/place where it is known that the result of normalizing is actually the correct way so that caching can be done correctly? The other way I thought of doing it is to rely on the snapshoting in the InferCtxt so that bad types can be rolled back but my implementation still seems to cache bad types in that implementation. |
This comment has been minimized.
This comment has been minimized.
|
It's worth nothing that over the last week or so I've been drawing up plans On Mon, Mar 7, 2016 at 12:10 PM, Markus Westerlind <notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
I will hold off working on this then. Looking forward to seeing this issue resolved. |
This comment has been minimized.
This comment has been minimized.
|
So, actually, I've been rethinking my "rethinking". That is, I now think the work on congruence closure is of secondary importance and can be deferred. I've implemented a simple cache for projection -- I have plans for a more elaborate one -- but it seems to be effective e.g. for the example in #31849. |
nikomatsakis
referenced this issue
Mar 18, 2016
Closed
Unsound projection when late-bound-region appears only in return type #32330
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis Is this still a problem today? |
This comment has been minimized.
This comment has been minimized.
|
This is still a thing today, although I've improved the situation in #48296 by reducing the complexity of recursion itself. |
nikomatsakis commentedDec 29, 2014
Both in trans and in typeck. Must be somewhat careful around type parameters and so forth. Probably we want to introduce a cache onto the fulfillment context to use for normalization as well.