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

Lots of "cannot find in scope" errors can make name resolution extraordinarily slow #63478

Closed
scottmcm opened this issue Aug 12, 2019 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Name resolution I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@scottmcm
Copy link
Member

I missed a use and found a check that takes over 4 minutes to fail.

Repro: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=aaac7e403ced051c0e4165df25a455a5

time-passes blames this on "name resolution"

@petrochenkov
Copy link
Contributor

Suggestion search does a lot of heavy stuff like loading all the known crates and searching names in them (#54391) and maybe something else.

This was never profiled or optimized, AFAIK, due to the general stance that "the error case can be slow".
So it's quite possible there are low-hanging fruits there, someone needs to run a profiler on that.

@jonas-schievink jonas-schievink added A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Name resolution I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 12, 2019
@Mark-Simulacrum
Copy link
Member

The reproduction in this issue fails to compile in a total of 1.3 seconds with 1.24 seconds spent in name resolution -- and duplicating the set a couple times only gets me up to around ~7 seconds so I feel like this can probably be closed now? It seems sort of "expected" that tons of errors will be slow...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Name resolution I-compiletime Issue: Problems and improvements with respect to compile times. 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