Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods take an insanely long time to compile #40280

Closed
tomaka opened this issue Mar 5, 2017 · 5 comments
Closed

Methods take an insanely long time to compile #40280

tomaka opened this issue Mar 5, 2017 · 5 comments
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@tomaka
Copy link
Contributor

tomaka commented Mar 5, 2017

This commit takes an insane amount of time to compile. Before the commit, the crate takes about 15 seconds to compile. After the commit, I stopped after around 15 minutes. EDIT: estimates would be about 2 hours.

I've isolated the problem to this code. These are two methods implemented on tuples. They should expand to roughly something like this:

let &(first, B, C, D, E, F, G, H) = self;
let iter = first.buffers_list();
let iter = iter.chain(B.buffers_list());
let iter = iter.chain(C.buffers_list());
let iter = iter.chain(D.buffers_list());
let iter = iter.chain(E.buffers_list());
let iter = iter.chain(F.buffers_list());
let iter = iter.chain(G.buffers_list());
let iter = iter.chain(H.buffers_list());
Box::new(iter)

If I reduce the maximum size of the tuple here to only 16 elements, the item-bodies checking pass takes about 11 seconds. With 17 elements, it takes about 18 seconds. With 18 elements, it takes about 33 seconds. With 19 elements, about 60 seconds.

cc @eddyb

@eddyb
Copy link
Member

eddyb commented Mar 5, 2017

I think this has to do with the depth of the nested Chain type.
cc @arielb1 @nikomatsakis Is it likely that the new trait system will solve this?

@durka
Copy link
Contributor

durka commented Mar 5, 2017

Is this #22204?

@nikomatsakis nikomatsakis added I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 7, 2017
@nikomatsakis
Copy link
Contributor

Nominating for triage. Seems likely to be related to #22204, haven't had time to investigate.

@nikomatsakis
Copy link
Contributor

Another issue that is basically the same: #38528

@nikomatsakis
Copy link
Contributor

Going to close in favor of #38528, I'll copy the example there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants