Status Update
Comments
ap...@google.com <ap...@google.com> #2
Thanks for the report and all the details. Are you only seeing these build speed issues on CI? What's the build speed like in local development?
It would be great if you could share the compiler dump file with
ap...@google.com <ap...@google.com> #3
Are you only seeing these build speed issues on CI? What's the build speed like in local development?
Hi, we usually don't run minified builds on our local environments, mainly because of the time it takes to run it and the amount of ram it would require.
I don't want to complain even more about it, but I'm sure you are already aware of the constraints that Android has. We already have the IDE taking +10GB, the Kotlin Compiler daemon (1-6GB depending on the compilation work needed), the Gradle daemon (usually around 14G at the end of the build). If we were to enable R8 on local builds, this would render local machines (even our beefy M1s) unable to use for minimum 15 minutes each time we would want to run the app. Devs will turn this off immediately.
A good starting point would be to check if there are any passes that take up an unusual amount of time.
Do you mean running the compiledump.py
? Is this what the dump will be used for? If so, can I do that locally without any external tool? I'd rather not share the dump if I can test it myself. If there is more to it, then I'll try to upload it somewhere safe.
Description
Allow an R8 compilation to only apply R8 to a part of the program, and compile the rest of the program with D8.
This allows developers to gradually opt in to using R8 by only applying it to the part of the program which has been sufficiently configured for R8 (i.e. has the required rules).
One way of using this could be to only compile libraries correctly configured for R8 with R8 and compile the remaining program with D8. The JetPack (
androidx
) libraries are good candidates here.The implementation expected to roughly take this overall approach:
This still leaves many details open (e.g. handling desugared library, feature splits, profiles, ...). This will also generate R8 compilations with larger parts of the program on classpath, which is not currently a common use case.