Hi. Is there please any way how to get more detail...
# ksp
t
Hi. Is there please any way how to get more detail performance statistics from KSP? In our project KSP take more than kotlin compilation, we are using room, dagger, anvil and some custom KSP plugin. I would like to know which KSP plugin took how much time, it will be somehow shared, right? But it is there a way how to somehow find which plugin is the bottleneck? I care mainly about incremental IDE build, where change in one class cause 25s KSP task and only 2s kotlin compilation. I would like to found what causing that 25s delay after just one class change.
👀 1
t
@Ting-Yuan Huang in theory Kotlin Gradle Plugin could add an API to send build metrics from KSP side as well
t
would be amazing if KSP could work with gradle and get them to expose whatever API ksp needs to pin it into build scans the way it can with java anno's
👍 1
t
That sounds like a good item in the todo list. For now, the only alternative might be using a profiler. BTW, what KSP version are you using? There have been a few compilation avoidance bugs fixed recently, and they'll likely help in your use cases.
t
I'm currently testing 2.1.20-1.0.31 and 2.1.20-2.0.0, sadly 2.x is in all scenarios slower than 1.x. I mean in full and incremental compilation.
Possibility to see some in-depth information in scan report would be awesome. But even some simple text output would help a lot. Something like https://blog.jetbrains.com/kotlin/2022/06/introducing-kotlin-build-reports/ Btw. Is there any tutorial or setup ho to use profiler just for KSP?
t
FWIW: easiest thing I have found was tell kotlin to run in-process then using something like async-profiler to run my build with gradle-profiler. no incremental caveat though. https://kotlinlang.org/api/kotlin-gradle-plugin/kotlin-gradle-plugin-api/org.jetbrai[…]asks/-kotlin-compiler-execution-strategy/-i-n_-p-r-o-c-e-s-s/
👍 1
t
@trevjones there is a way to run incrementally with
in-process
execution strategy 🙂
if you add
kotlin.compiler.runViaBuildToolsApi=true
into
gradle.properties
- IC should start working
❤️ 3
we will write more details about it in 2.2.0 what's new, but it is also available in the older Kotlin releases