Status Update
Comments
sg...@google.com <sg...@google.com> #2
I am not sure I understand the use case. how can the benchmark be code to real world scenario when it's not possible to do right now ? which scenario is it ?
In any case, since this would be for benchmarking, this would clearly not be available through the public DSL. We should find a semi-private way of doing this (maybe the private variant API object could offer that functionality for instance or a property).
Er...@gtempaccount.com <Er...@gtempaccount.com> #3
We want benchmarks to measure code after Progaurd / R8, but it's not possible to turn that on for androidTests in library modules at the moment (to my knowledge?)
Benchmarks are also a public facing thing, but we have a plugin to help configure gradle builds for our users, so if support for this ends up in a private API, we could try to keep those usages localized to our code perhaps.
ap...@google.com <ap...@google.com> #4
Any update on the status of this request and when it can be supported?
Thanks,
Amanda
ap...@google.com <ap...@google.com> #5
this is not part of our OKR at this point so we are not talking soon. at first glance, we would need to simulate usage patterns to minify against and such, this seems substantial amount of work. there are not a lot of library module that have android tests, most only rely on unit-tests.
how important is this ? we are out of PM right now but I suspect the next step will be to negotiate with J. Eason and xav@ to scale a priority level.
ap...@google.com <ap...@google.com> #6
This is a high priority request for Compose, to enable their benchmarks to measure release accurate performance. (Micro) Benchmarks are library modules, as they don't need the complexity of multi-apk tests - they're self measuring APKs that depend on libraries. (d.android.com/benchmark)
there are not a lot of library module that have android tests, most only rely on unit-tests.
To clarify, this is for com.android.library
modules, not jars - I'd expect most of those to use android tests (all of the libraries in jetpack for example do).
we would need to simulate usage patterns to minify against and such, this seems substantial amount of work
Simulate usage patterns? I don't understand - the dev can themselves provide a keep rule for test infra / classes if necessary. Long term, keep rules should be provided by test libraries.
ap...@google.com <ap...@google.com> #7
We've been experimenting with ways to work around this for Compose. Performance results from R8 seem significantly different, and would enable us to measure much more accurately. I've tried to come up with a workaround using a com.android.app module, and while it almost works (and we can get measurements), it's extremely hacky and doesn't let us run tests anymore via Studio:
ap...@google.com <ap...@google.com> #8
Bumping this request, as Compose has recently had more interest in the ability to benchmark with and without R8 enabled.
We're fine if the default implementation doesn't work with minification (tree shaking) - we're happy to supply those rules ourselves, or simply evaluating with minification off to take advantage of other optimizations.
ap...@google.com <ap...@google.com> #9
Juan, this might be something to put on our OKR in the near future, I think you chat with Amanda to set the priority.
ap...@google.com <ap...@google.com> #10
Hey everyone, I am catching up on feature requests and saw this one. I'll schedule time for us to talk about this in a few days.
ap...@google.com <ap...@google.com> #11
Ivan, can you provide a rough estimate on how long this would take ?
sg...@google.com <sg...@google.com> #12
I think this is a duplicate of
My understanding of this feature request is the following:
- As a library author, I'd like to write microbenchmarks in my library subproject that measure performance of my library after it's been processed by R8 [1]
Chris/Dustin, is this correct? If [1] is correct, this is a duplicate of a duplicate of
an...@google.com <an...@google.com> #13
As a small correction, it's:
- As a user of microbenchmarks, I'd like to measure performance of code processed by R8
For a bit more context, we generally recommend library and app devs create a completely new, empty library module to add microbenchmarks to, e.g. mylib/src/androidTest/
.
For this reason, we don't particularly care about the minified main library component from the same module.
This librarytest-only focus does have the downside that app devs must pull code into a library to be microbenchmarks, and maybe that could be something improved if there was a good minification story across the test and app module boundary, but that's a separate (but related) concern for the future.
For right now, we care about libraries with empty main directories running R8 on the code in androidTest and its dependencies.
Description
I updated AGP to 8.7.3 (uses R8 8.7.18) and observed one screen began to crash with
NullPointerException
when it called Coroutinejob?.cancel
method.I downgraded back to AGP 8.6.1 (uses R8 8.6.27) which no longer crashes.
I have made a sample project that replicates the code and crash.
Steps to reproduce
alpha
. This creates an obfuscated build.Launch countdown Activity
debug
. This is not obfuscated . Try the above steps and observe it works.If you downgrade the versions and build
alpha
it does not crash.Note my real project and sample project both have
android.enableR8.fullMode=false
ingradle.properties
.