Status Update
Comments
cc...@google.com <cc...@google.com>
cc...@google.com <cc...@google.com> #2
cc...@google.com <cc...@google.com> #3
cc...@google.com <cc...@google.com> #4
Branch: androidx-master-dev
commit 3ed3fb003fa6c1244f923202859a616225b5b2fa
Author: Ian Lake <ilake@google.com>
Date: Fri Feb 14 11:17:46 2020
Create an interface for layouts that can be opened
Create a common interface that represents layouts
that have two states: open and closed. This allows
higher level libraries to rely on the interface,
rather than concrete implementations such as
DrawerLayout, making them more resilient to
changes in the current recommended implementation.
Fixes: 129979320
Test: ./gradlew checkApi
Change-Id: I0f2a1414977825aa053c6555261f2b7d4417bd19
M customview/customview/api/1.1.0-alpha02.txt
M customview/customview/api/current.txt
M customview/customview/api/public_plus_experimental_1.1.0-alpha02.txt
M customview/customview/api/public_plus_experimental_current.txt
M customview/customview/api/restricted_1.1.0-alpha02.txt
M customview/customview/api/restricted_current.txt
A customview/customview/src/main/java/androidx/customview/widget/Openable.java
M drawerlayout/drawerlayout/api/1.1.0-alpha03.txt
M drawerlayout/drawerlayout/api/current.txt
M drawerlayout/drawerlayout/api/public_plus_experimental_1.1.0-alpha03.txt
M drawerlayout/drawerlayout/api/public_plus_experimental_current.txt
M drawerlayout/drawerlayout/api/restricted_1.1.0-alpha03.txt
M drawerlayout/drawerlayout/api/restricted_current.txt
M drawerlayout/drawerlayout/build.gradle
M drawerlayout/drawerlayout/src/main/java/androidx/drawerlayout/widget/DrawerLayout.java
M jetifier/jetifier/migration.config
M slidingpanelayout/slidingpanelayout/api/1.1.0-alpha01.txt
M slidingpanelayout/slidingpanelayout/api/current.txt
M slidingpanelayout/slidingpanelayout/api/public_plus_experimental_1.1.0-alpha01.txt
M slidingpanelayout/slidingpanelayout/api/public_plus_experimental_current.txt
M slidingpanelayout/slidingpanelayout/api/restricted_1.1.0-alpha01.txt
M slidingpanelayout/slidingpanelayout/api/restricted_current.txt
M slidingpanelayout/slidingpanelayout/src/main/java/androidx/slidingpanelayout/widget/SlidingPaneLayout.java
ch...@google.com <ch...@google.com> #5
Wow, the performance improvement was way more than I was expecting. I was expecting more along the lines of 5% not 20%-30%. Do other benchmarks improve in a similar way?
If so, I will take a background task of investigating which of the R8 optimizations have the biggest impact on compose. We might consider "pre-optimizing" our code to lessen the impact of R8 if we can get some of these improvements without R8. We want to perform well without R8 so R8 doesn't become a defacto requirement of compose.
As for studio, I don't run benchmarks in studio. I always use the command-line and a custom script to interpret the results so not being able to run them from Studio would not affect me.
However, I periodically will need to debug the benchmarks. Having a split, such as the above, would be very nice if the src/main
version was easy to debug (e.g. if the |>
worked).
du...@google.com <du...@google.com> #6
I had a go on this on my end and couldn't figure out how to get connectedCheck to recognize that there are test classes defined in src/main
- it's probably best try the split method, but we have some setup before hand so its not as clean in terms of being able to copy the classes back directly when minifyEnabled gets support on library modules.
du...@google.com <du...@google.com> #7
(This is on collections).
cc...@google.com <cc...@google.com> #8
I was expecting more along the lines of 5% not 20%-30%. Do other benchmarks improve in a similar way?
I don't know, I only looked at the one to get it up and running - you can cherry pick the linked CL to try it out on other benchmarks.
I always use the command-line and a custom script to interpret the results so not being able to run them from Studio would not affect me
Depending on which benchmarks we want to modify, it may hit others who are accustomed to running from Studio. If we want to commit this, keeping it scoped to runtime only may make sense.
couldn't figure out how to get connectedCheck to recognize
I don't think I did anything special, though I did play around with sourcesets a lot. Are you able to run this CL locally? It may have been only working for me due to some cached gradle/studio state.
cm...@google.com <cm...@google.com> #9
Just checking I follow your logic in #3 - the challenge is that you want all the test entry points to be roots for R8 to keep - which currently is not supported for app tests (and is potentially a bit odd for 'normal' app users as having the production shrunk build depending on tests might be suprising) and that moving them to the main sourceset breaks studio being able to run them.
So possibilities look like androidx only
- Create an app with the tests with different build types for shrunk/not shrunk
- For studio support split the @Test bodies in to a class in src/main and add keep rules for that class, or manually curate keep rules. agp/studio
- Fix studio running tests that are in main in an app
- Support tracing @Tests in androidTest when shrinking the app in AGP
- Add special support to AGP for shrinking library tests
- Shrinker support in library is
- Add test only module support for shrinking and library targets.
cc...@google.com <cc...@google.com> #10
Yes, (not sure what you mean by androidx only, since some of them are general solutions) though I'd add another possibility is the AGP support for macrobenchmarks source directory within existing modules, as we discussed a while back.
Also, the more general bug for R8 + Microbenchmark is here:
cc...@google.com <cc...@google.com>
cc...@google.com <cc...@google.com> #11
This is now possible with AGP changes, I was able to get simple tests running with minification on in a standalone project.
Once the required version of AGP lands in AndroidX, I'll add an example for local experimentation with R8 in microbenchmarks, and we can consider options for how we want to use this in CI.
These are the rules I used to test the integration in a standalone project:
# basic protection against junit/androidx.test reflection, shouldn't affect library/test code
-keepclasseswithmembers class androidx.test.** { *; }
-keepclasseswithmembers class org.junit.** { *; }
-dontwarn com.google.errorprone.annotations.MustBeClosed
## keep test classes
-keepclasseswithmembers @org.junit.runner.RunWith class * { *; }
## needed for org.junit.Test annotation to be discoverable by reflection
-keepattributes *Annotation*
ap...@google.com <ap...@google.com> #12
Branch: androidx-main
commit cecc57fb5899034f12f886a2784129098d059a8d
Author: Chris Craik <ccraik@google.com>
Date: Tue Mar 05 16:46:59 2024
Experimental R8 support in microbenchmarks
Off by default in the AndroidX repo, but can be experimentally used by
external. As this isn't run in presubmit/postsubmit, it may require
adding additional rules for any specific test.
```
(androidTest.enableMinification = false)
840,772 ns 389 allocs Trace LazyListScrollingBenchmark.scrollProgrammatically_newItemComposed[LazyColumn]
837,786 ns 389 allocs Trace LazyListScrollingBenchmark.scrollProgrammatically_newItemComposed[LazyRow]
(androidTest.enableMinification = true)
658,050 ns 390 allocs Trace LazyListScrollingBenchmark.scrollProgrammatically_newItemComposed[LazyColumn]
651,393 ns 390 allocs Trace LazyListScrollingBenchmark.scrollProgrammatically_newItemComposed[LazyRow]
```
(Mokey, locked clocks)
Test: LazyListScrollingBenchmark.scrollProgrammatically_newItemComposed
Fixes: 184378053
Relnote: """Experimental R8 support in microbench via embedded proguard
rules. Note that this support is experimental, and requires AGP 8.3
for minification of library module tests. Use the following to enable
in your benchmark module's `build.gradle`:
```
android {
buildTypes.release.androidTest.enableMinification = true
}
```
"""
Change-Id: I738a3294c5ded7b336ed0f49d0615eb9231cce51
M benchmark/benchmark-junit4/build.gradle
A benchmark/benchmark-junit4/proguard-rules.pro
M compose/benchmark-utils/build.gradle
A compose/benchmark-utils/proguard-rules.pro
M compose/foundation/foundation/benchmark/build.gradle
cc...@google.com <cc...@google.com> #13
With the above CL, this can be enabled locally with the following in your build.gradle:
android {
buildTypes.release.androidTest.enableMinification = true
}
No further proguard customization needed in most cases.
pr...@google.com <pr...@google.com> #14
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-junit4:1.3.0-alpha02
androidx.compose.foundation:foundation:1.7.0-alpha05
androidx.compose.foundation:foundation-android:1.7.0-alpha05
androidx.compose.foundation:foundation-desktop:1.7.0-alpha05
Description
Ideally we can track improvements for minified code (post r8 transforms) as compose sometimes make optimizations depending on these, e.g., changes to enable aot to inline.
It's currently impossible to apply:
to a benchmark module, even if has been converted to an app module because it fails with either:
1.
2.