Is there still a performance difference between gr...
# gradle
u
Is there still a performance difference between groovy and kotlin dsl?
t
kotlin dsl on first run is slower, because it spins up kotlin compiler for compiling scripts
u
first build?
t
build from clean state when gradle deamon is not available, read https://github.com/gradle/kotlin-dsl-samples/issues/902
n
Unfortunately the Kotlin compiler is dependent on the JVM, hence it takes a while to warm up from a cold state.
If the Kotlin compiler was a native executable (eg developed using Kotlin Native) then startup time wouldn't be a issue
u
@tapchicoma im confused on the 3x, so a clean first build take for me now 3min, youre saying its going to be 9min with kotlin dsl? hope not
t
definetly not 9min, as building the project not only includes compiling build scripts
how much worse it will be depends on your project build scripts count and complexity
g
Mentioning of Kotlin Native in context of Kotlin Compiler is completely not realistic, it's huge JVM application that cannot be rewritten easily on K/N Not including that most probably performance would be much worse. If we talking about startup time, you can try Kotlin Compiler compiled with AOT Excelsior compiler, but compile performance even for small scripts is only sometimes faster for small scripts and always slower on bigger projects. So it's very naive to think that compiler performance is problem that cannot be solved by some magical "native" solution
Also Gradle itself is JVM, so there is no penalty for Kotlin compiler in context of Kotlin Gradle DSL, not mentioning that Groovy is also JVM
Real solution is to make compiler faster and improve tooling, not some magical "native" solution
3 times slow down is for for particular use case with completely clean project mostly because of tooling problems
s