Just enabled the new K2 compiler in our project. N...
# compiler
v
Just enabled the new K2 compiler in our project. Not a super big project, just a regular back-end API service. But already see the difference in compilation time. đź‘Ť In the

1.7.0 release videoâ–ľ

there’s another flag -
-Xbackend-threads=4
. But it doesn’t affect the compilation time regardless of number of threads I specify. Am I doing something wrong or missing?
Copy code
compileKotlin {
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_11
        freeCompilerArgs = ["-Xuse-k2", "-Xbackend-threads=4"]
    }
}
d
cc @udalov
u
Results might vary for different projects. If it’s an open source project, or at least it can be shared with the JetBrains team, we can investigate what’s happening. Also, parallel mode requires a bit more memory during compiler execution, so increasing it might help (e.g.
kotlin.daemon.jvmargs=-Xmx...
in
gradle.properties
)
v
Thanks for the answer. Sorry, can’t share it, it’s a commercial internal project, so can’t share it outside of the org.
Anyway, it’s fine. Not a super big project