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

Remove unnecessary imports analyzer is significantly slowing builds (11% CPU time) #72162

Closed
Youssef1313 opened this issue Feb 17, 2024 · 5 comments · Fixed by #73263
Closed
Assignees
Labels
Area-Analyzers Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it

Comments

@Youssef1313
Copy link
Member

image

@mavasani How can this be disabled? I already have dotnet_diagnostic.IDE0005.severity = none in .globalconfig file.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 17, 2024
@lonix1
Copy link

lonix1 commented Mar 8, 2024

What tool is that?

@Youssef1313
Copy link
Member Author

@lonix1 The one in the screenshot? It is PerfView.

@sharwell
Copy link
Member

sharwell commented Apr 18, 2024

@Youssef1313 I think this may be a red herring. The analyzer does almost no actual work. It just instructs the compiler to complete work it would already complete, and then then waits for that work to finish. If this analyzer has any impact on the total time it takes to complete a build for the case where there are no IDE0005 diagnostics reported, it is an indicator that the diagnostics and/or binding cache in the compiler is broken.

@Youssef1313
Copy link
Member Author

@sharwell This was solely through binlog times and profiling with PerfView. I agree that likely the total time may not be affected. It indeed looks like a cost that "moved" from the compiler to the analyzer.

The remaining issue here will still be why it's running even with dotnet_diagnostic.IDE0005.severity = none

@sharwell
Copy link
Member

@Youssef1313 it's running because the following line incorrectly sets hasAnyCodeStyleOption to true:

RemoveUnnecessaryImportsConstants.DiagnosticFixableId, EnforceOnBuild.Never, hasAnyCodeStyleOption: true, "", "", isConfigurable: false);

@genlu genlu added Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 24, 2024
sharwell added a commit to sharwell/roslyn that referenced this issue Apr 29, 2024
sharwell added a commit to sharwell/roslyn that referenced this issue Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants