Kotlin 1.4.20 - slower build

Viewed 190

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

Basic info:

  • Gradle 6.7.1
  • Kotlin 1.4.20 or newer 1.4.21
  • Android Gradle Plugin 4.1.1
  • Gradle Daemon VM heap size is ok
  • Windows and Linux tested - same result

Screenshots - same build, same machine - just changed Kotlin version

Kotlin 1.4.10

Kotlin 1.4.20

1 Answers

It was caused by kotlin.parallel.tasks.in.project set to true in the gradle.properties.

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. 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 Kotlin 1.4.20.

Something about kotlin.parallel.tasks.in.project https://blog.jetbrains.com/kotlin/2019/01/kotlin-1-3-20-released/

Related