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

Extract Execute method checks to reduce code duplication and improve performance for other registration method #8423

Open
sebastien-marichal opened this issue Nov 29, 2023 · 0 comments
Labels
Type: Performance It takes too long.

Comments

@sebastien-marichal
Copy link
Contributor

#8414 brought performance improvement for SyntaxNodeAction registration.
Unfortunately, this creates some code duplication of the Execute method, especially regarding the checks on whether or not the SyntaxTree should be analyzed.

Here are the checks to cache:

The idea is to follow what was done for RegisterNodeAction and apply it to other registration methods: Register for CompilationStartAction, do the checks or get it from the cache, and execute this action.

This should be possible for all registration actions except for:

  • CompilationStartAction
  • CompilationAction

Possible solutions:

  • Have the checks in CompilationStartActionContext, as of today (for RegisterNodeAction)
  • Have the checks in a dedicated method in SonarAnalysisContext.
@sebastien-marichal sebastien-marichal added the Type: Performance It takes too long. label Nov 29, 2023
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

1 participant