Status Update
Comments
ma...@google.com <ma...@google.com> #2
ml...@google.com <ml...@google.com> #3
ma...@google.com <ma...@google.com>
ma...@google.com <ma...@google.com> #4
ma...@google.com <ma...@google.com> #5
ml...@google.com <ml...@google.com> #6
Branch: androidx-main
commit 78a3847fafbb5a810b60b27b1361400bf8dcfa58
Author: Marcello Albano <maralb@google.com>
Date: Mon Jul 11 14:07:07 2022
Added a new compilation mode `CompilationMode.Ignore` to skip profile reset and compilation.
Bug: 230453509
Test: ./gradlew :benchmark:integration-tests:macrobenchmark:cC -Pandroid.testInstrumentationRunnerArguments.class=androidx.benchmark.integration.macrobenchmark.CompilationModeTest
This change adds a new compilation mode `CompilationMode.Ignore` that will skip profile reset and compilation. This can be used to customize the benchmark loop.
Change-Id: Ibbcf8e8c627d227e0f290bddf464b67d9b6653bc
Relnote: Added a new compilation mode `CompilationMode.Ignore` to skip profile reset and compilation.
A benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/ExperimentalMacrobenchmarkApi.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/CompilationMode.kt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt
A benchmark/integration-tests/macrobenchmark/src/androidTest/java/androidx/benchmark/integration/macrobenchmark/CompilationModeTest.kt
M benchmark/benchmark-macro/api/public_plus_experimental_current.txt
ma...@google.com <ma...@google.com> #7
I agree but there isn't much we can do. This is also not related to AGP but to how gradle works: assemble
is a task that also "prepares" the configurations (that in gradle are used to carry artifacts). When triggering the configuration we use to expose the baseline profile artifacts the GMD device setup also starts, since it's part of the task chain to produce the artifact.
The only option we've is to decide when to disable those specific tasks, so that the configuration won't have any artifact and don't generate/update the baseline profile.
The property I've implemented is one way. The other way I've explored is to check what task the user invoked but this can potentially break other flows. For example, consider if the user launched:
./gradlew :baselineprofile:assemble :app:generateBaselineProfile :app:assemble
The result is that the baseline profile wouldn't be generated (or updated), the app would be assembled and there would be no failure. Other examples could be cases in which the user defined its own task and adds a dependency on the generation task.
Disabling some tasks based on what the user launched might ultimately be worse in other settings. I think a good trade-off is documentation and the above mentioned property but I'm open to ideas.
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit 79938912e132e8fb24ece4e24d067637e8ea5fe0
Author: Marcello Albano <maralb@google.com>
Date: Wed May 24 11:42:52 2023
Added option to skip baseline profile generation
This PR introduces a new property
`androidx.baselineprofile.skipgeneration` used by the baseline profile
producer plugin. When the property is on it will disable test tasks and
provide empty artifact for baseline profiles. This is helpful for
Github CI projects that don't support KVM.
Enabling this property has the same effect of:
./gradlew assemble \
-x :baselineProfile:pixel6Api31NonMinifiedReleaseAndroidTest \
-x :baselineProfile:collectNonMinifiedReleaseBaselineProfile
Test: ./gradlew :benchmark:benchmark-baseline-profile-gradle-plugin:test
Bug:
Change-Id: I37fda3f4b5761d8229c83be7d7a2cda197e8dbc8
Relnote: Added property to skip baseline profile generation. Usage: `./gradlew assemble -Pandroidx.baselineprofile.skipgeneration`.
M benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/consumer/task/MergeBaselineProfileTask.kt
M benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/producer/BaselineProfileProducerPlugin.kt
A benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/producer/BaselineProfileProducerProperties.kt
M benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/producer/tasks/CollectBaselineProfileTask.kt
M benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/producer/tasks/InstrumentationTestTaskWrapper.kt
M benchmark/baseline-profile-gradle-plugin/src/test/kotlin/androidx/baselineprofile/gradle/consumer/BaselineProfileConsumerPluginTest.kt
M benchmark/baseline-profile-gradle-plugin/src/test/kotlin/androidx/baselineprofile/gradle/producer/BaselineProfileProducerPluginTest.kt
Description