-
Notifications
You must be signed in to change notification settings - Fork 231
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
Fix S1854 Performance: Rule can be very slow in some scenarios #5384
Labels
Milestone
Comments
costin-zaharia-sonarsource
added
Area: CFG/SE
CFG and SE related issues.
Type: Performance
It takes too long.
Type: Bug
Exceptions and blocking issues during analysis.
labels
Feb 11, 2022
costin-zaharia-sonarsource
changed the title
S1854 can be very slow in some scenarious
S1854 can be very slow in some scenarios
Feb 11, 2022
Also reported in #5382 by @rauhs:
I've reported it also to Roslyn: dotnet/roslyn-analyzers#5870 |
pavel-mikula-sonarsource
removed
the
Type: Bug
Exceptions and blocking issues during analysis.
label
Feb 15, 2022
@rauhs Can you share a reproducer with us? By public or private channel. |
This was referenced Feb 16, 2022
Side effect: Memory allocation issue is fixed in #5401 |
This doesn't reproduce on my machine. I can rebuild it with all rules in 10 minutes. There are things to improve, but they are not the root cause of this. |
Merged
pavel-mikula-sonarsource
changed the title
S1854 can be very slow in some scenarios
Fix S1854 Performance: Rule can be very slow in some scenarios
Feb 17, 2022
github-actions
bot
assigned costin-zaharia-sonarsource and pavel-mikula-sonarsource and unassigned pavel-mikula-sonarsource and costin-zaharia-sonarsource
Feb 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Source: https://community.sonarsource.com/t/azure-devops-build-stuck-after-migrating-from-sq-9-1-to-sq-9-2/56783
When analyzing the reproducer project created by our user, the rule https://rules.sonarsource.com/csharp/RSPEC-1854 increased the build time from ~1m to ~130m.
I can reproduce the issue on my side and it was confirmed by the user that deactivating the rule will fix the problem.
At the first glance the problem is in the new CFG generation code since
IOperationWrapperSonar
has 48.4% of the memory allocations (considering only our code):and uses a significant part of the processor time:
Repro steps
Analyze the repro project created by the user.
Expected behavior
The analysis finishes in a reasonable time.
Actual behavior
The total build time increases from 1m without the rule, to 130m when the rule is active.
Known workarounds
Removing the rule from the quality profile.
Related information
The text was updated successfully, but these errors were encountered: