-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Add FilterTree/FilterSpan API on remaining analysis contexts #68052
Conversation
…lAnalysisContext Work towards dotnet#68033 - Add FilterTree/FilterSpan API on SymbolStartAnalysisContext and SymbolAnalysisContext - Move IDE code style SymbolStart analyzers to respect the FilterTree/FilterSpan API
Can you expand on that? Are we generating events and iop trees that are not needed? |
No, this is not redundant - the core thing is the driver has to pessimistically assume that at least one of the SymbolStart analyzer would execute on the entire symbol declaration (including all method bodies within it). Current approach for driving analyzer execution is via relevant compilation events which are generated by invoking |
Closes dotnet#68033 Follow-up to dotnet#68052
Closes dotnet#68033 Follow-up to dotnet#68052
…ead in the filter span for additional file diagnostic requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiler changes seem fine to me. Have not reviewed outside the compiler layer.
src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalysisScope.cs
Outdated
Show resolved
Hide resolved
src/Analyzers/CSharp/Analyzers/InlineDeclaration/CSharpInlineDeclarationDiagnosticAnalyzer.cs
Outdated
Show resolved
Hide resolved
...nalyzers/CSharp/Analyzers/MakeStructMemberReadOnly/CSharpMakeStructMemberReadOnlyAnalyzer.cs
Show resolved
Hide resolved
...nalyzers/CSharp/Analyzers/MakeStructMemberReadOnly/CSharpMakeStructMemberReadOnlyAnalyzer.cs
Show resolved
Hide resolved
...nalyzers/CSharp/Analyzers/MakeStructMemberReadOnly/CSharpMakeStructMemberReadOnlyAnalyzer.cs
Show resolved
Hide resolved
...nalyzers/CSharp/Analyzers/MakeStructMemberReadOnly/CSharpMakeStructMemberReadOnlyAnalyzer.cs
Outdated
Show resolved
Hide resolved
...nalyzers/CSharp/Analyzers/MakeStructMemberReadOnly/CSharpMakeStructMemberReadOnlyAnalyzer.cs
Outdated
Show resolved
Hide resolved
...nalyzers/CSharp/Analyzers/MakeStructMemberReadOnly/CSharpMakeStructMemberReadOnlyAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/Analyzers/CSharp/Analyzers/UseLocalFunction/CSharpUseLocalFunctionDiagnosticAnalyzer.cs
Show resolved
Hide resolved
src/Analyzers/CSharp/Analyzers/UsePatternMatching/CSharpAsAndNullCheckDiagnosticAnalyzer.cs
Outdated
Show resolved
Hide resolved
src/Analyzers/CSharp/Analyzers/UsePatternMatching/CSharpIsAndCastCheckDiagnosticAnalyzer.cs
Outdated
Show resolved
Hide resolved
...stractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs
Show resolved
Hide resolved
...stractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs
Show resolved
Hide resolved
src/Analyzers/Core/Analyzers/UseAutoProperty/AbstractUseAutoPropertyAnalyzer.cs
Show resolved
Hide resolved
src/Analyzers/Core/Analyzers/UseAutoProperty/AbstractUseAutoPropertyAnalyzer.cs
Show resolved
Hide resolved
src/Analyzers/Core/Analyzers/UseAutoProperty/AbstractUseAutoPropertyAnalyzer.cs
Show resolved
Hide resolved
...oveUnusedParametersAndValues/VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb
Outdated
Show resolved
Hide resolved
src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs
Show resolved
Hide resolved
...orkspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/AnalysisContextExtensions.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SyntaxNodeExtensions.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signing off IDE side. didn't look at compiler side.
slightly nervous about Location instances, but we can see in traces if its an issue. likely we get so much savings that this is worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signing off IDE side. didn't look at compiler side.
slightly nervous about Location instances, but we can see in traces if its an issue. likely we get so much savings that this is worth it.
@dotnet/roslyn-compiler for a second review |
@dotnet/roslyn-compiler for a second review. This PR gives us an observable performance gain for lightbulb scenarios. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiler changes LGTM.
Thanks! |
Work towards #68033
Performance measurements
All analyzers
All high + normal priority analyzers for lightbulb (excludes SymbolStart/End and SemanticModel analyzers)
SymbolStart/End analyzers (known expensive analyzers)
SemanticModel.GetDiagnostics()
onLanguageParser.cs
takes ~1.8 seconds, which is about 75% of the time (~2.2 seconds) for computing analyzer semantic diagnostics for the same file.