Hello everyone, we see huge build performance hit ...
# android
m
Hello everyone, we see huge build performance hit just because of updating from 1.4.10 to 1.4.20 in execution phase of the build. The number of times retrieved cache etc. seems the same. Almost each module just takes sometimes 10 times more time to compile. Any hint where to look? Thanks Gradle 6.7, Android Gradle plugin 4.1.1
Copy code
org.gradle.parallel=true
kotlin.parallel.tasks.in.project=true
org.gradle.caching=true
kapt.incremental.apt=true
android.enableBuildCache=true
kapt.use.worker.api=true
android.injected.testOnly=false
org.gradle.vfs.watch=true
android.useAndroidX=true
android.enableJetifier=false
k
What's your mx heap set to? Guessing it's too small now...
m
Tried to set it as below (I have 48GB available) but with no change. Our project has around 200 modules so is pretty big. Is there any way how to check if heap size is set sufficiently? org.gradle.jvmargs=-Xmx24576m -XX:MaxPermSize=8192m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError
k
We have a few more than that and only need 10gb.... That's huge 😮 On one of the build scan tabs, it shows how much time it's doing garbage collecting.... You want to minimize that. Doesn't sound like that's the cause if you have it set that high...
m
I agree. It was overkill just to be sure that this is not causing any issues. Here is example of heap size and time spent doing garbage collecting. It seems fine to me.
k
Yeah... That's fine. That's the only thing I could think of that would cause such a huge spike in builds times...
Compare each build step to see if any modules are much slower and then try taking annotation processors out? (That assumes an annotation processor is to blame...useless if kotlinc is the real culprit)
m
Just for "historic reasons" - it was caused by kotlin.parallel.tasks.in.project set to true.
👍 2
k
so they ran out of memory?
m
I'm not sure. I can't see nothing wrong in the Gradle Scan about memory problems (see above). If you know any other way how to see that I can try it. This flag is mostly for building debug/release build types in parallel etc. We're not doing that so it was fine for us to turn it off. It was turn on "by accident" for few years. After turning it off we also see build times to be few seconds better. It still will be mystery for me why there was such large performance hit when updating to 1.4.20.
k
mystery for me as well.. blob shrug