{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/33816","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/33816/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/33816/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/33816/events","html_url":"https://github.com/rust-lang/rust/pull/33816","id":156301364,"number":33816,"title":"Projection cache and better warnings for #32330","user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/relnotes","name":"relnotes","color":"fad8c7"}],"state":"open","locked":false,"assignee":{"login":"arielb1","id":1830974,"avatar_url":"https://avatars.githubusercontent.com/u/1830974?v=3","gravatar_id":"","url":"https://api.github.com/users/arielb1","html_url":"https://github.com/arielb1","followers_url":"https://api.github.com/users/arielb1/followers","following_url":"https://api.github.com/users/arielb1/following{/other_user}","gists_url":"https://api.github.com/users/arielb1/gists{/gist_id}","starred_url":"https://api.github.com/users/arielb1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arielb1/subscriptions","organizations_url":"https://api.github.com/users/arielb1/orgs","repos_url":"https://api.github.com/users/arielb1/repos","events_url":"https://api.github.com/users/arielb1/events{/privacy}","received_events_url":"https://api.github.com/users/arielb1/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2016-05-23T15:14:24Z","updated_at":"2016-06-04T13:46:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/33816","html_url":"https://github.com/rust-lang/rust/pull/33816","diff_url":"https://github.com/rust-lang/rust/pull/33816.diff","patch_url":"https://github.com/rust-lang/rust/pull/33816.patch"},"body":"This PR does three things:\r\n\r\n- it lays the groundwork for the more precise subtyping rules discussed in #32330, but does not enable them;\r\n- it issues warnings when the result of a leak-check or subtyping check relies on a late-bound region which will late become early-bound when #32330 is fixed;\r\n- it introduces a cache for projection in the inference context.\r\n\r\nI'm not 100% happy with the approach taken by the cache here, but it seems like a step in the right direction. It results in big wins on some test cases, but not as big as previous versions -- I think because it is caching the `Vec<Obligation>` (whereas before I just returned the normalized type with an empty vector). However, that change was needed to fix an ICE in @alexcrichton's future-rs module (I haven't fully tracked the cause of that ICE yet). Also, because trans/the collector use a fresh inference context for every call to `fulfill_obligation`, they don't profit nearly as much from this cache as they ought to.\r\n\r\nStill, here are the results from the future-rs `retry.rs`:\r\n\r\n```\r\n# Before\r\n06:26 <nmatsakis> time: 6.246; rss: 44MB  item-bodies checking \r\n06:26 <nmatsakis> time: 54.783; rss: 63MB   translation item collection\r\n06:26 <nmatsakis> time: 140.086; rss: 86MB    translation\r\n\r\n# After\r\n06:26 <nmatsakis> time: 0.361; rss: 46MB  item-bodies checking\r\n06:26 <nmatsakis> time: 5.299; rss: 63MB    translation item collection\r\n06:26 <nmatsakis> time: 12.140; rss: 86MB translation\r\n```\r\n\r\n~~Another example is the example from #31849. For that, I get 34s to run item-bodies without any cache. The version of the cache included here takes 2s to run item-bodies type-checking. An alternative version which doesn't track nested obligations takes 0.2s, but that version ICEs on @alexcrichton's future-rs (and may well be incorrect, I've not fully convinced myself of that). So, a definite win, but I think there's definitely room for further progress.~~\r\n\r\nPushed a modified version which improves performance of the case from #31849:\r\n\r\n```\r\nlunch-box. time rustc --stage0 ~/tmp/issue-31849.rs  -Z no-trans\r\nreal    0m33.539s\r\nuser    0m32.932s\r\nsys     0m0.570s\r\nlunch-box. time rustc --stage2 ~/tmp/issue-31849.rs  -Z no-trans\r\nreal    0m0.195s\r\nuser    0m0.154s\r\nsys     0m0.042s\r\n```\r\n\r\nSome sort of cache is also needed for unblocking further work on lazy normalization, since that will lean even more heavily on the cache, and will also require cycle detection.\r\n\r\nr? @arielb1 "},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/223756519","html_url":"https://github.com/rust-lang/rust/pull/33816#issuecomment-223756519","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/33816","id":223756519,"user":{"login":"bors","id":3372342,"avatar_url":"https://avatars.githubusercontent.com/u/3372342?v=3","gravatar_id":"","url":"https://api.github.com/users/bors","html_url":"https://github.com/bors","followers_url":"https://api.github.com/users/bors/followers","following_url":"https://api.github.com/users/bors/following{/other_user}","gists_url":"https://api.github.com/users/bors/gists{/gist_id}","starred_url":"https://api.github.com/users/bors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bors/subscriptions","organizations_url":"https://api.github.com/users/bors/orgs","repos_url":"https://api.github.com/users/bors/repos","events_url":"https://api.github.com/users/bors/events{/privacy}","received_events_url":"https://api.github.com/users/bors/received_events","type":"User","site_admin":false},"created_at":"2016-06-04T13:46:09Z","updated_at":"2016-06-04T13:46:09Z","body":":pushpin: Commit 480d18c has been approved by `arielb1`\n\n<!-- @bors r=arielb1 480d18ca311f5e0de2b6b0003f6cd0746e142652 -->"}}
{"actor":{"display_login":"bors"}}