Commit 892ca2d
committed
Only scan the affected suffix of the provisional cache
`insert_provisional` walks the whole provisional cache on every insert to
lower `reached_depth`. Everything it can affect was inserted while
`from_dfn` was on the stack, so it is a suffix of this insertion-ordered
map and the walk can stop at the first older entry.
The full walk is quadratic in the size of the cache, which only fills up
for types that are mutually recursive. Proving `Send` for a graph of N
such types did about N^2 iterations of this loop: 641M for N=480.
`evaluate_obligation` on that graph, before and after:
N=60 63ms -> 41ms
N=120 172ms -> 80ms
N=240 531ms -> 167ms
N=480 - -> 316ms
which is the linear growth the same graph already has when it is acyclic.1 parent 2850f83 commit 892ca2d
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3116 | 3116 | | |
3117 | 3117 | | |
3118 | 3118 | | |
3119 | | - | |
3120 | | - | |
3121 | | - | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
3122 | 3124 | | |
| 3125 | + | |
3123 | 3126 | | |
3124 | 3127 | | |
3125 | 3128 | | |
| |||
0 commit comments