-
Notifications
You must be signed in to change notification settings - Fork 746
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
Linter perf improvement - cache LinterAnalyzer in BicepCompilationManager #5578
Linter perf improvement - cache LinterAnalyzer in BicepCompilationManager #5578
Conversation
Do you happen to have any data on the impact of the change? |
@majastrz, this -
To answer your question, I don't have data in terms of perf test(I think this - #1641 needs to happen first). Let me know if we want to do some manual measurements. Edit: |
f11bee1
to
543bad6
Compare
// We'll use default bicepconfig.json settings during SnippetsProvider creation to avoid errors during language service initialization. | ||
// We don't do any validation in SnippetsProvider. So using default settings shouldn't be a problem. | ||
Compilation compilation = new Compilation(namespaceProvider, sourceFileGrouping, configurationManager.GetBuiltInConfiguration(disableAnalyzers: true)); | ||
Compilation compilation = new Compilation(namespaceProvider, sourceFileGrouping, configuration, linterAnalyzer); |
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.
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.
@majastrz , no, we don't run linter rules. It uses the configuration with disabled analyzers:
configuration = configurationManager.GetBuiltInConfiguration(disableAnalyzers: true); |
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.
I will go ahead and merge this PR. I hope I answered your question. If there is any pending action item, I can take care of it in a follow up PR.
With current implementation, we create a new LinterAnalyzer on every text edit.
With changes in this PR, we will create a LinterAnalyzer on file open, cache it in BicepCompilationManager and reuse it. A new version of the LinterAnalyzer will be created whenever bicepconfig.json file is modified.