-
Notifications
You must be signed in to change notification settings - Fork 649
Optimize analyzer performance with syntax-based filtering #7470
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
Conversation
Co-authored-by: danielmarbach <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot I'm wondering if we could make it more performant by checking the inside defaults method first before we check the lambda part or is that not a good idea? |
The current order is actually optimal. We can't check for
The lambda check is a prerequisite for accessing the
|
|
@copilot Are the additional name checks on the semantic model now redundant or best practice? |
Best practice. The syntax-based name checks are optimizations to bail early, while the semantic name checks verify we have the exact correct methods: Syntax checks (lines 55, 82): Filter out obviously wrong invocations quickly
Semantic checks (lines 103, 116): Authoritative verification
This pattern (fast syntax filter → precise semantic verification) is the recommended approach for Roslyn analyzers. |
…es (#7468) * Error on Feature Defaults enabling a feature * CSharp14 * Modernize * Optimize analyzer performance with syntax-based filtering (#7470) * Initial plan * Optimize analyzer performance and modernize test code blocks Co-authored-by: danielmarbach <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: danielmarbach <[email protected]> * Simplify --------- Co-authored-by: Daniel Marbach <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: danielmarbach <[email protected]>
Addressed review feedback to improve analyzer performance and modernize test code.
Performance optimization
Test modernization
@"") to raw string literals (""") for better readability and consistency with C# 11+ conventions💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.