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

Add caching for symbols retrieved by TokenTypeAnalyzer and SymbolReferenceAnalyzer #4218

Closed
costin-zaharia-sonarsource opened this issue Apr 9, 2021 · 1 comment
Labels
Type: Performance It takes too long.

Comments

@costin-zaharia-sonarsource
Copy link
Member

Both TokenTypeAnalyzer and SymbolReferenceAnalyzer retrieve the same symbols and by caching them we will reduce the processor time used by these 2 rules in half. I did a POC and for the repro I've added I have the following results:

from:

    31.131   28      SonarAnalyzer.Rules.CSharp.TokenTypeAnalyzer
    31.065   28      SonarAnalyzer.Rules.CSharp.SymbolReferenceAnalyzer

to:

    29.596   41      SonarAnalyzer.Rules.CSharp.TokenTypeAnalyzer
     0.019   <1      SonarAnalyzer.Rules.CSharp.SymbolReferenceAnalyzer
@pavel-mikula-sonarsource
Copy link
Contributor

Duplicate #4217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Performance It takes too long.
Projects
None yet
Development

No branches or pull requests

2 participants