We have a very large Multiplatform app and the kot...
# kotlin-native
d
We have a very large Multiplatform app and the kotlin / native build times are getting a little hard to live with. We are sitting around 6 minutes clean build for a simulator build with roughly 2.5 incremental with the new experimental incremental compilation turned on. Are these times in line with what others have seen? are there any flags I can set to inspect which parts are taking a long time to link?
Would having lots of modules increase the linking time? Our code base is very modular and we are at about 180 modules
k
That is already fairly fast...you must be used to web build speeds 😂 For reference, typical Android projects take 2-3min incremental and 15-20min full builds with 300-500 modules...
d
Holy those are some slow android builds. I recently got our android down to 4 minute full and 30 ish second incremental
Configuration cache helped a lot
But you do have a lot more modules
k
We have config cache as well...but also part of it is a monolith, so when things change in that, the world rebuilds. Let's just say most Android devs would be happy w/ your build speeds 😉
d
I bet, have you experimented with attempting to make some of your modules pure kotlin modules instead of android. I did some tests today and it seems to cut down our compilations buy more than 30%.
k
yep we have pure Kotlin and pure Java modules. That does help a lot because AGP adds android testing support, etc. We're almost all over on KSP (KAPT is much slower), but legacy codebase so we have cruft everywhere that slows things down...
d
never used KAPT but i was trying to optimize our KSP usage today, we have a bunch of custom built processors. It seems as though they can take up to a second to run.. which seems long to me. What kind of times do you usually see for your KSP tasks?
k
I don't think we've profiled that much of recently. I do know Hilt/Dagger takes the longest...
a
There was a cool talk by Jason Parachoniak at kotlin conf, It's prioritised to bump on the LLVM part of the compiler that would yield some better compile times for native.

https://www.youtube.com/watch?v=5sOXv-X43vcâ–¾

d
I missed that talk! def a good watch. Hopefully we see something of this update in the next couple versions