Hi all. I was wondering what are your usual build ...
# multiplatform
r
Hi all. I was wondering what are your usual build times for KMP projects? We have around 270 shared modules for SwiftUi app and the release build time currently takes around 2 hours. (debug build is much faster, like 10-20min) We use cocoapods, the modules vary from little ones (with 2 classes to bigger ones 100+-classes). The step that takes almost all time is ./gradlew -p shared kmmsharedKmm:syncFramework -Pkotlin.native.cocoapods.platform=iphonesimulator -Pkotlin.native.cocoapods.archs=arm64 -Pkotlin.native.cocoapods.configuration=Release I wonder if such build times are normal, or if there is something we can do to speed it up.
t
also in 2.2.20 release we finally will add support for https://kotlinlang.org/docs/gradle-compilation-and-caches.html#build-reports for Native part. It would be nice if you could shared them to us once you will update you project to this release
👀 1
r
Build reports for native part sounds cool. Definitely will look into it once possible. I will look into the page for improving compilation times as well. Do you think this build times are far too high than expected?
t
Hard to tell without build metrics. This is a release build where much more is optimized. Plus we don't know amount of code you have in the project
r
@tapchicoma is it possible to try this kotlin native build reports in 2.2.20 beta?
t
Beta1 has a problem on the Native compiler side which is fixed in Beta2, so please try in the next beta
🆗 1
r
Hello I tried in Beta2 and I see following times
Copy code
Task ':kmm:sharedKMM:linkPodReleaseFrameworkIosSimulatorArm64' finished in 17,699.94 s
Time metrics:
  Total Gradle task time: 17,699.94 s
  Spent time before task action: 0.11 s
  Run compilation in Gradle worker: 5,139.18 s
    Run native in process: 5,139.18 s
      Run entry point: 5,139.17 s
    Compiler initialization time: 0.17 s
    Compiler code analysis: 0.35 s
    Compiler translation to IR: 10.54 s
    Compiler IR lowering: 20.38 s
    Compiler backend: 5,107.70 s
Size metrics:
  Start time of task action: 2025-07-31T21:27:49
Is this the kotlin native build report or is there something more somewhere? At the moment I see almost all time is taken by Compiler backend
@tapchicoma
t
yes, this is the report. You could try to enable JSON format and share it with us