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

Better requests organization #1088

Closed
3 tasks done
CsCherrYY opened this issue Nov 15, 2021 · 1 comment · Fixed by #1152
Closed
3 tasks done

Better requests organization #1088

CsCherrYY opened this issue Nov 15, 2021 · 1 comment · Fixed by #1152
Labels
enhancement New feature or request
Milestone

Comments

@CsCherrYY
Copy link
Collaborator

CsCherrYY commented Nov 15, 2021

Currently, we have two requests to get something from the Gradle build:

  • GetBuild
  • GetProjects

When the build file changes, the request GetBuild and GetProjects will be called both. GetBuild is used to get some information (mostly tasks) of a root project and GetProjects is used to get some information of a specific project (can be a subproject). They have some similar process and might be optimized. Since opening a new connection will use more resources than using an existing one, and getting the project content has less resource requirement, I'll try to find a way to optimize it.

The time when we call GetBuild requests:

  • One of the child project's build files has been changed.
  • user manually refresh

The time when we call GetProjects requests:

  • The current project's build file has been changed.
  • user manually refresh

If we merge these two requests and make some changes to them, we can obtain

  • better performance, since we can get all information via one TAPI request
  • less resource consumption (only one connection per workspace folder)
  • clear and readable code

we will do the following steps:

@CsCherrYY
Copy link
Collaborator Author

The current structure is

image

The drawback is we will frequently change the GradleConnector directory of tooling API, which causes a lot of Gradle daemon stop/start when the project has multiple modules. So we plan to use this model:

image

In this model the GradleConnector will always for the workspace folder directory, and we can specific the project folder and use ParameterizedToolingModelBuilder to avoid fetching useless information. All the information will come from request getBuild().

And the remaining problem is the Gradle Connector mechanism, about when to create a new daemon and how to cache the existing daemons (or whether we need to do this). If the number of opened workspaces is more than one, should we have some caches to store the existing GradleConnector?

cc @donat for suggestions and comments about the Gradle daemon mechanism.

@CsCherrYY CsCherrYY unpinned this issue Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment