How fast is compilation in general for you? I'm at...
# kotlin-native
m
How fast is compilation in general for you? I'm at ~3min to execute
linkDebugFrameworkMacosX64
after changing one string, which slows down development quite a lot. Is that expected, should I buy a bigger machine or am I doing something wrong ?
d
I'm at about 20 seconds. I haven't seen up to 3 mins before though, is it a big project? Are you using cinterop?
m
It's this one: https://github.com/HearthSim/Arcane-Tracker/tree/master/kotlin-hslog. I don't think I'm using cinterop but there a few modules involved. Also the exported api might be a bit large as I didn't really look at optimizing it
compileKotlin takes maybe 30% of the time, the biggest contributor is the link task
d
I haven't built/linked a framework before, so I don't know if it's particularly slow, but I do know slowness is expected with Kotlin/Native builds rn. Things should speed up by 1.4, by a lot.
2
m
The framework linking phase looks pretty intense. Linking a release framework sometimes takes up to 5min
k
mine's high with 2 iOS targets
m
@Kris Wong do you mean it's taking you a long time as well ?
k
yes
😕 1
👍 2
I am guessing there's not much in terms of incremental processing
n
oof, I’m at 8-10 minutes because I’m on a minimally specced Early 2015 MacBook Pro
k
Mine runs up to 6 mins. 😢
m
Oh wow. Good to know I'm not alone in this... Looking forward to kotlin 1.4.
k
On 1.3.70, we can export frameworks on a multi-module project. https://github.com/JetBrains/kotlin-native/issues/2423#issuecomment-550197856 This would make it faster.
d
Scary stuff. Waiting 8-10 minutes because you want to change some constant.
m
I'm looking into running gradle from a workstation stadia-like if it can bring it down to 4-5min it's already something... https://kotlinlang.slack.com/archives/C0B8H786P/p1578046777035300
p
I'm also seeing linking times of 3-5 minutes for a windows target
Compiling usually only takes about 20% of the total time.
k
I was able to speed up my assemble time by removing the compilation for iosArm64Test, as well as only building release frameworks
that cut the number of target binaries in half
p
What's the option to only build release binaries?
k
Copy code
targets.withType<KotlinNativeTarget> {
        binaries.framework(listOf(RELEASE))
    }
🎉 1
s
they don't care, every release it is becoming slower and slower https://github.com/JetBrains/kotlin-native/issues/733 they should have never shipped KN with such slow compile time, you see it with how low adoption is, i just can't understand why nobody else care
1
i am pretty sure it also affect JB productivity, this is why development and progress of KN is so slow, TDD must be a nightmare, even the compiler takes an eternity to compile
take a look at the year this issue was reported, 2017
KN could have been HUGE and so much more popular, the product manager have failed
and on top of that, they are silent, they don't even acknowledge how slow it is
JB have reputation of building slow software, and KN is no different.. that's gonna hurt them big in the future, can't wait to see their cloud IDE that requieres high VPS specs that it's gonna cost them a fortune to run
m
IntelliJ is sometimes slow but also best of its class in terms of features. I don't mind K/N beeing slow too much as long as it eventually settles to something reasonnable
Also because most of my code is MPP so I can test on the JVM without having to wait on K/N compilation each time. I can see how painful it would be to have to wait 5min each iteration 😕