I have a simple hello.kt file I want to compile on my macbook (Catalina) with the latest kotlin-native.
kotlinc-native 1.4.10-rc-405 (JRE 13.0.2+8)
It takes over 20 seconds seconds, which I think is longer then normal.
time kotlinc-native hello.kt
Executed in 26.77 secs fish external
usr time 26.32 secs 166.00 micros 26.32 secs
This is with the -verbose option
kotlinc-native -verbose hello.kt
logging: using Kotlin home directory dist/kotlinc
Do you have any idea?
I suspect you are compiling using the command line. While it’s viable, it’s probably not a good option to do so. When using Gradle and the Kotlin/Native plugin (or Kotlin/Multiplatform with a native target) each compilation step is carefully cached and only some portion of your code will be recompiled only if necessary.
Using gradle does not mean you won’t use the command line! I often use Gradle from command line, the same way you would use a Makefile!
Also keep in mind that K/N is in beta and K/JVM received a big boost in copilation speed just recently and its development it’s much ahead oh K/N. Give it some time