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

IDE0072: Add missing cases to enum takes extremely long time for enums with many values. #65937

Open
vsfeedback opened this issue Dec 12, 2022 · 1 comment
Assignees
Labels
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]
In an application with a shared DLL across projects, an enum with many values (in my test case - 406 values - admittedly beyond the use of a typical enum), the switch expression IDE0072 refactor "add missing cases" takes extremely long - both attempts so far have gone >30 minutes before I killed the application.

Please consider a review of this feature - it's great, but the implementation smells a little bit like O(n^2) :)


Original Comments

Feedback Bot on 12/8/2022, 02:44 AM:

(private comment, text removed)

Sam Harwell [MSFT] on 12/8/2022, 01:38 PM:

(private comment, text removed)

Chris Danek on 12/9/2022, 05:40 PM:

(private comment, text removed)

Feedback Bot on 12/12/2022, 08:23 AM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 12, 2022
@sharwell
Copy link
Member

@CyrusNajmabadi copying my comment from ADO to here:

The bulk of the work here is running the simplifier on all the switch expression cases. I believe the refactoring is generating fully-qualified references to the enum type, and then running the simplifier on them to reduce it to the simple enum name. I'm wondering if we could optimize this case by showing that if A.B.C.D simplified to C.D in a given context, then a later reference to A.B.C.E in the same context could simplify to C.E without running all the simplifier checks (specifically the speculative binding).

@arkalyanms arkalyanms added this to the 18.0 milestone Aug 7, 2023
@arkalyanms arkalyanms removed the untriaged Issues and PRs which have not yet been triaged by a lead label Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants