I have a fairly simple project for kotlin, but its build (even hot) takes minutes. I change a couple of lines in the body of a regular function, build, and compileKotlin gradle task takes 2-3 minutes. I tried to use a variety of options for debugging, and that most of the time the compiler does not show what is busy. It just loads the processor core to maximum and that’s it. And it shows warnings in files that do not affect changes in any way.
The compiler and gradle settings can be said to be standard. The question is how to understand what the compiler has been doing for so long. It may be possible to hire a specialist for 1-2 hours, so that he understands and speeds up the build?
Strange. I only ever see warnings for files that are changed. Make sure that you don’t have incremental building disabled. Can’t think of anything else that might cause this.
In any case the kotlin compiler is not the fastest at the moment and the kotlin team is aware of this. The next release (1.4) will primarialy focus on a compiler rework that both simplifies further development and should also bring significant performance benefits. So I would wait for that before spending to much money/time on improving build performance. 1.4 is supposed to be released in spring 2020 so I guess it won’t take more than 1 or 2 months now.
Also I think I remember a few discussions where increasing the available memory might have helped. This is however at best second hand, anecdotal evidence so take that with a grain of salt .