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

Only process each buildscript once in JavaGradleProjectResolver #2983

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akerimsenol
Copy link
Contributor

This should improve import performance for large projects

@@ -50,6 +50,9 @@
@Order(ExternalSystemConstants.UNORDERED)
public final class JavaGradleProjectResolver extends AbstractProjectResolverExtension {

private final IdentityHashMap<GradleBuildScriptClasspathModel, List<BuildScriptClasspathData.ClasspathEntry>> buildScriptEntriesMap =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused by the explicit usage of IdentityHashMap here. Are the instances of GradleBuildScriptClasspathModel internalized?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, it was my experience that they were always the same, but I don't fully understand why. I can dig deeper to understand.

@@ -50,6 +50,9 @@
@Order(ExternalSystemConstants.UNORDERED)
public final class JavaGradleProjectResolver extends AbstractProjectResolverExtension {

private final IdentityHashMap<GradleBuildScriptClasspathModel, List<BuildScriptClasspathData.ClasspathEntry>> buildScriptEntriesMap =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storing state here will cause memory leak, as this class is a long-living service. It is not re-created on each sync.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will apply your suggestion from the other PR here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants