Hello!
A beginner question: Does koin 3 annotations impact build time?
a
Alejandro Rios
04/11/2022, 2:01 PM
You can ask in #koin
j
Javier
04/11/2022, 2:01 PM
It has to do codegen so yes
☝️ 1
a
agrosner
04/11/2022, 3:42 PM
it uses ksp, as long as caching and incremental ksp are properly hooked up in the module, build times should be minimally impacted. KSP is seen to be twice as fast as KAPT
g
gildor
04/11/2022, 6:12 PM
It’s really nice, but I wouldn’t say that “build times should be minimally impacted” == “KSP is seen to be twice as fast as KAPT”
Even twice as fast, is still can be significant time
➕ 1
a
agrosner
04/12/2022, 12:42 PM
minimally compared to KAPT, I meant. not overall 😅
g
gildor
04/13/2022, 1:58 AM
with only 2 times difference, actual implementation of code generator also important
You cannot compare arbitrary code generators one with Kapt, one with KSP, because they actually do some work and performance depends on many factors, also build time increase is not not always linear with increase of amount of code/usages, it can be logarithimic or quadratic or worse
KSP is beneficial in terms of build speed for existing processors, because you do not get additional stabs generation step, but it doesn’t mean that you can assume performance of code generator only by the fact that it uses KSP
disclaimer: I know nothing about actual performance of Koin code generation and effect on build time, my comment is purely theoretical.
P.S. do not believe any performance claims without proper benchmark (and in many cases it’s very hard or impossible to have one) or until you measure it yourself on your own project with your use cases
j
Javier
04/13/2022, 9:53 AM
Currently there is no codegen with kapt, so the comparison is doing nothing vs generating things, so it impacts the build time.