-
Notifications
You must be signed in to change notification settings - Fork 434
KT-24668 - Kotlin DSL 3-4x slower than Groovy DSL on FIRST USE on many simple projects build #902
Comments
Is this also true with importing into the IntelliJ? |
It might be helpful to do a similar measurement with the following parameters:
|
Ways to improve the situation include:
|
Hi @eskatos , I am curious if this issue was already resolved? |
@joshuadeguzman first use is still that slower, dominated by the Kotlin compiler. It could still benefit from parallel compilation and incremental changes to build logic could still benefit from compilation avoidance as linked above. |
Great! Thank you for the confirmation @eskatos . |
@eskatos Any plans to get this done (seems repo is not active)? I think this may be the reason Android Studio Kotlin DSL support lagging behind? |
We have two performance tests running respectively the Groovy DSL and the Kotlin DSL on the same large project for a first use use case:
Those links (use Login as guest) are for current There we can see that the Kotlin DSL build is still ~3x slower than the Groovy DSL build on first use. Then, on repeated use without changes, this performance test compares Groovy DSL vs. Kotlin DSL:
In that use case, we can see that the Kotlin DSL build is ~10% slower than the Groovy DSL build. That's it for the current state of affairs. Now on how to make the situation better, my #902 (comment) above still stands. In any case the best bet to make the situation better across all use cases would be for the Kotlin compiler itself to get faster, this is in JetBrains hands. Otherwise, compiling the scripts in parallel gradle/gradle#9225 could also make all use cases faster (most probably benefiting to the Groovy DSL too 😃) but this isn't trivial and will require deep changes in Gradle. IOW it'll take time. The most probable next step is some form of compilation avoidance for Kotlin DSL scripts gradle/gradle#9224 that will make the change in build logic use case faster (not scheduled for now but I'll push for it). I hope the above clarifies the situation. |
@eskatos Thanks for the detailed response! |
thanks for the detailed explanations @eskatos & an alternative workaround EDITED:
|
Groovy DSL ~18s
scenario:
first use of largeJavaMultiProject
template:
largeJavaMultiProject
performance test results
Kotlin DSL ~75s
scenario:
first use of largeJavaMultiProjectKotlinDsl
template:
largeJavaMultiProjectKotlinDsl
performance test results
Both with:
The compilation of the 500 build scripts of the example build by the Kotlin compiler dominates wall clock. Note that script compilation is not parallelized in Kotlin nor Groovy.
See the upstream KT-24668 investigation issue.
The text was updated successfully, but these errors were encountered: