Just started using Hot Reload (alpha10). My reloa...
# multiplatform
r
Just started using Hot Reload (alpha10). My reloads take about 10 seconds on a M3 Max (for example changing a height in a modifier). Is this expected?
I see that the
composeApp:compileKotlinDesktop (8789 ms)
is run every time
k
iit really depends on how your build is structured as you checked the logs it builds everytime, you can create a seperate module for components this ways builds are faster and thus hotreload
z
You could try the kotlinconf-app project, on my M2 Max it takes a couple seconds at most to perform a reload in there, even cross-module. Either your project is significantly larger, or something might be suboptimal in your build configuration / caching. @Sebastian Sellmair [JB] might be able to comment more.
thank you color 1
s
Compose Hot Reload is currently the technology which reloads your code in a live application. How the code is compiled is unchanged, therefore builds with incremental compile times of, lets say 10 seconds, will also have to wait 10 seconds for the classes to arrive before Hot Reload is able to swap them on a live application. We'll stabilize this core technology first, then we can look into our build infrastructure and figure out why sometimes incremental builds take so long for people. I am sure that something is not right and we can squeeze a lot here 😎 So far, the best things you, as a build author, can do is: • enable Gradle configuration cache • enable caching • structure the project to optimize for quick IC builds • Follow Gradle best practices to avoid unnecessary work being done on IC builds
thank you color 2
a
If it's like me, you're probably experiencing non-incremental builds when making changes in
commonMain
To verify this • add
kotlin.build.report.output=file
to
gradle.properties
• compile once, make your padding change, compile again • check
build/reports/kotlin-build
at the root • You should see
Non-incremental compilation will be performed: UNSAFE_INCREMENTAL_CHANGE_KT_62686
in the txt file (Referenced issue)
r
Thanks! Yes indeed it is the same issue, UNSAFE_INCREMENTAL_CHANGE_KT_62686
Interesting that I do not find anything related other than this ticket, and this ticket was supposed to have been fixed in 2.0.0 beta3? I am on 2.1.10
s
cc @tapchicoma (Sorry Yahor for pinging you, but I think you're the best one to dispatch the IC topic?)
thank you color 1
t
That is true for IC in multiplatform - it never compiles incrementally the same module. Though compilation avoidance for JVM should work. The problem is fundamental in the Kotlin compiler and compiler team is working on the proper solution.
thank you color 1
s
cc @Azat Abdullin: (So you're also in the loop) To summarize: Compose Hot Reload is stabilizing the tech to reload the classes, the Compiler team is working on drastically improving the incremental builds.