RedundantAssignmentIssue is extremely slow when the control flow graph is complex #476
Labels
No labels
Bug
Feature Request
NR6Pack
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-icsharpcode/NRefactory#476
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is probably easiest to explain by showing the test I wrote:
github.com/corngood/NRefactory@c35584b934This test will take an extremely long time to complete, and scales non-linearly with the number of if statements. When walking a complex part of the call-graph which doesn't contain any references to the variable, it ends up doing an exhaustive search in RedundantAssignmentIssue.GatherVisitor.ProcessNode.
My initial thought was to just flag variables without any non-assignment references, but A slight variation on the test:
github.com/corngood/NRefactory@bf5fe2aa27shows the same behaviour can occur even when a reference exists.