Closed SimonMarquis closed 1 month ago
Thanks for the report! Could you please try if using a newer R8 version has any effect, see https://r8.googlesource.com/r8/+/refs/heads/master/#replacing-r8-in-agp (just in case this is an issue with R8 which is fixed in newer versions).
Do you know if there is some way to find out why R8 performance has decreased for Gson or if there is some way to make R8 output profiling data about where it takes the most time?
Since you already have VisualVM connected, could you please try enabling the Sampler and share the results (and the R8 version you are using)? Maybe that in combination with the R8 obfuscation mappings (see https://r8.googlesource.com/r8/+/refs/heads/master/#obtaining-prebuilts, r8lib.jar.map
) could help at least narrowing it down.
Maybe it would also be worth asking on the R8 mailing list mentioned at https://r8.googlesource.com/r8/+/refs/heads/master/#getting-help.
Unable to reproduce consistently at this time.
Gson version
2.11.0
Java / Android version
Java 17-21
Used tools
Description
Bumping from Gson 2.10.1 to 2.11.0 leads to
minifyDebugWithR8
task execution time. Going from ~2m 46s to 3m 30s.On our CI we are running 3 parallel builds (Android flavors) with parallelized proguard
-Pandroid.r8.maxWorkers=3
and an insane amount of RAM (72GiB). It used to build fine in ~15min before the update, and now it can no longer build because of these regressions.Reproduction steps
Compare 2 Android builds configured with proguard minification and with the two different versions.
Notes
This might be related to the recent inclusion of new proguard rules in the binary, but even after switching to these new rules (and keeping the old dependency) the increase in execution time and heap size usage is not as huge as it is with the new version.