Reduce delegate command calls when classpath changes #3439
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR use the project uri from the classpath update event to reduce the delegate command invocation when checking the lombok dependency.
Previously, when a classpath update event comes, the extension will check the lombok dependency for all java projects. It was not using the project uri of the classpath update event. Assume a workspace contains 10 projects, it will generate 10*10=100 getClasspath command invocation.
I did a benchmark roughly for the project: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring with following steps:
java.trace.server
to messageWithout the change, it takes 7 mins and 30 secs, with 3295 requests sent to server.
With this change, it takes 5 mins and 40 secs, with 347 requests sent to server.