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
GradleProject model should not include the task lists. #8898
Comments
Also an overloaded register function to provide the task group earlier would be beneficial. In current API, tasks are needed to be realized and configured in order to determine their groups. This leads all tasks to be configured which is not necessary even when users are indeed using the pane. |
@ducrohet There's already a Tooling API model ( |
Let's leave this open until we hear back from Xav. |
It turns out that IntelliJ does not actually use GradleProject so we will attempt to fix this there. However I think the bug still stands. Also the comment about group/description on |
We're currently looking into this more actively. IntelliJ has its own way to populate its task list window and we can (and will) disable that (or put it behind a setting at least.) However, it does query for We are going to need to find a way to do this. One possibility would be to include a parameter to call |
Sorry for the late reply. So, if I understand correctly, you need to change the content of the Parameterizing the corresponding model builder would be an option, but it requires a bit of design. I'm planning to create a Gradle test snapshot for which you can set a system property that disables the task creation. With that, you can measure the impact of skipping the task creation. How does that sound? |
Hi, we can do some test with a flag, that would be a good way to look at the impact of this. I think with regard to an actual solution, moving to something that's compatible with |
I've created patched Gradle 5.6 release in which you can influence the
I've used the Gradle profiler in conjunction with the perf-android-large project to measure the performance difference. I used the following scenario file for the measurement:
Running the scenarios with 5 warm-ups and 50 iterations each I got the following results:
It seems that the serialisation is negligible in the tested scenario, and realising the task graph itself is also acceptable, just a few hundred milliseconds for a project with ~21.000 tasks. Of course, this is not conclusive as the tested project is a synthetic one. Do you have a large, real-life project at hand on which you can reproduce this measurement? |
Also keep in mind that this operation in IDEs are not run that often. Only when Gradle files actually change. |
@tasomaniac opening the IDE / project and switching branches also triggers this, and it makes Android Studio unususable for a few minutes in projects with 1k modules. |
@donat It seems the link to the patched 5.6 is gone? |
Interesting. I'll recreate it for you today. |
@ducrohet if this makes it in gradle, will we have a UI button to enable/disable the task list from Android Studio ? |
Better late than never, here's the patched distribution you can test with: https://services.gradle.org/distributions-snapshots/gradle-6.1-branch-donat_remove_tasks_from_tapi_model-20191004160515+0000-bin.zip |
@donat , I tried your version. It works fine to build our project on the command line but I get this issue in Android Studio: I tried renaming the gradle distribution to change the version to 6.1, but it didn't work. Here is the full idea.log stack trace. Is the gradle version embedded in the jar ?
Can I simply add this to our
Or I should hack the init.gradle file ? |
@stephanenicolas I think the easiest is to rebuild my fork locally. It might take a few minutes, but the result version should be accepted by the Tooling API. |
@donat I will try later today. I never built gradle yet.. |
Almost. The value should be specified as a system property (and not as a project property). The correct
or this:
|
Thx for the details with the properties. I was not sure about it. I guess
your fork is experimental only for now, but I would prefer project
properties,
if it makes sense and they can be passed easily during the sync. AS will
probably also want to have a few UI options to parametrize these.
Le mar. 8 oct. 2019 à 06:47, Donát Csikós <notifications@github.com> a
écrit :
… Almost. The values should be specified as system properties (and not as
project properties). The correct gradle.properties file should look like
this:
systemProp.skip_task_serialization=true
systemProp.skip_task_load=true
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8898?email_source=notifications&email_token=AAN7PXIJUAU5EHVYDESIWO3QNSFQRA5CNFSM4HCLWYZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAUHGMA#issuecomment-539521840>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAN7PXLV2SH53R3ORS3UMATQNSFQRANCNFSM4HCLWYZQ>
.
|
@donat I manged to build your branch, thx for the help. And AS is using it. I am not sure the system properties are correctly passed during a sync. It is really strange because I even hacked your branch to hard code all the conditions: it never computes the list of tasks and even less realize them. Though, the list of tasks is still there in AS, and the sync times are almost unchanged. I am 100% sure that I am using the gradle fork from AS. |
I think I understood the problem: the sync doesn't follow the gradle version used to build the app:
It uses the tooling apis shipped with AS... How can we change that ? @donat |
AFAIC it can only be done by rebuilding AS from the sources. This is only an experiment thought. Why don't you change my branch and hard-code the removal of the task graph removal from the model, rebuild the Gradle distribution and use it in your AS project? You only need to comment out the parts that are guarded by the |
@donat, I believe AGP instructs AS how to run gradle.during a sync. Anyway,
yes, I ended up hard coding the change to stop realizing the tasks.
The results were not as good as expected though. First, Android Studio has
an internal mechanism to refresh the tasks list, this has been made lazy in
3.6.
So I tried the forked gradle version with AS 3.6, and then I could get
around 40 sec gains over a 6 mn sync. The main issue is now coming from the
kotlin gradle plugin that still realize tasks.
A change similar to yours is definitely an improvement in the
right direction though. I wish gradle sync in AS become debuggable,
parametrizable, properly logged, profilable, etc.
S.
…On Thu, Oct 10, 2019, 02:47 Donát Csikós, ***@***.***> wrote:
AFAIC it can only be done by rebuilding AS from the sources. This is only
an experiment thought. Why don't you change my branch and hard-code the
removal of the task graph removal from the model, rebuild the Gradle
distribution and use it in your AS project? You only need to comment out
the parts that are guarded by the GradleProjectOptions system property.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8898?email_source=notifications&email_token=AAN7PXLE6FDXYM3D5OYH443QN322HA5CNFSM4HCLWYZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA3TVUI#issuecomment-540490449>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN7PXIVGCO5MRDPV5CSMXLQN322HANCNFSM4HCLWYZQ>
.
|
I'm actually looking into how can we profile Gradle in the IDE-context. |
AFAIU Android Studio is a fork of IDEA, right? If that's true, you can just replace loading |
It is not a fork. It's a custom distribution of IDEA with the Android plugin and some custom productization (name, splashcreen and some custom UI around projects management to be Android only). The code of the platform is untouched. |
Good to know. Now, I understand the situation better. |
For the sake of completeness, the PR for introducing system properties to disable task creation is merged. |
Thx Donat, I could see it.
Le mar. 17 déc. 2019 à 07:55, Donát Csikós <notifications@github.com> a
écrit :
… For the sake of completeness, the PR
<#11441> for introducing system
properties to disable task creation is merged.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8898?email_source=notifications&email_token=AAN7PXKKATPDGMWRFHNINMTQZDZAFA5CNFSM4HCLWYZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHC25OQ#issuecomment-566603450>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN7PXL2ULYGXP73AMF6N33QZDZAFANCNFSM4HCLWYZQ>
.
|
@ducrohet @stephanenicolas Can you please share some numbers on the performance gained in your test projects? |
I am wondering if we can see any performance improvement (I didn't do any
measurement yet).
But my inquiry is that there are other parts of the sync that do also
realize all tasks: namely, the construction of the kotlin model during a
sync
triggers the creation of all tasks. (I can send you 1-2 tickets number, but
they are on a different computer).
So, I am really wondering if we can measure any improvement yet, even with
the new flag being enabled. If you think so, @xavier Ducrohet
<xav@google.com> & @donat, then I will measure.
Le lun. 20 janv. 2020 à 01:07, Donát Csikós <notifications@github.com> a
écrit :
… @ducrohet <https://github.com/ducrohet> @stephanenicolas
<https://github.com/stephanenicolas> Can you please share some numbers on
the performance gained in your test projects?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8898?email_source=notifications&email_token=AAN7PXPCUDR65LKSRE63IOLQ6VSU5A5CNFSM4HCLWYZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJL4EVA#issuecomment-576176724>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN7PXPNM5FQUVSQ3DGXZPTQ6VSU5ANCNFSM4HCLWYZQ>
.
|
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
As far as I know Android Studio did improvements on this area. The task list is no longer generated on sync which speeds up sync time. But that comes with a disadvantage since the tasks are no longer visible in the IDE and does not show up in autocompletion either. That's why I don't think this issue is stale. It would be nice to benefit from this speed improvement while having just a list of task names available |
org.gradle.tooling.model.GradleProject
is the key entry point for syncing project in IntelliJ (IJ) and Android Studio (AS). We need to query this model first before querying our more specialized models.Currently, it also contains the list of tasks. This is used in IJ/AS to display the task in the Gradle pane on the right.
We would like to make this optional somehow. Maybe make the current model always return an empty list, and provide a different model that returns the task list if needed.
Our reasoning:
GradleTask
includes the group and description that requires a task configuration. Side note, it would be nice to be able to set these, as well as dependencies onTaskProvider
, but in our case it's just simpler to not return the tasks at all.A different option might be to only provide the tasks that have a group associated with them. Right now it includes all the tasks, including the ones that don't have groups. None of these are meant to be called directly (in the case of Android at least). Doing this would require us to be able to set group on
TaskProvider
to avoid triggering configuration.The text was updated successfully, but these errors were encountered: