vineethraj49
08/24/2022, 4:36 AMDid K2 compilation went well?yep. few minor fixes for type inference (+-10 lines), and having to bump up to 1.7.20-Beta due to this bug but was fine otherwise.
Have you noticed a difference in the build speed?yep! our biggest module went from 44s to 20s on average so that’s great! overall, we see a ~25% improvement
Or what errors you encountered with, if they happened?1. aforementioned bug 2.
value?.property
on a definitely non-null value
was complaining, but am assuming it’s by design, so just fixed it
3. if both kotlin-stdlib-jdk8
and kotlin-stdlib-jre8
are somehow on path, the compiler complains about “confusing overloads”. excluding -jre8
worked.dmitriy.novozhilov
08/24/2022, 7:47 AMvalue?.property
is nullable by design, yes. Existing behavior in K1 compiler is against specification (check KT-46860 for more details)
Two different stdlibs is a build issue and it complains by design too: when someone reference class, then compiler chooses first class with that name found in classpath, but when someone reference function, compiler need to find all functions with that name in all dependencies because of overloads. I wonder how it worked for you with K1 compilerdmitriy.novozhilov
08/24/2022, 7:49 AMsemoro
08/24/2022, 12:52 PM// Linux only, refer to async-profiler wiki for explanation
sysctl kernel.perf_event_paranoid=1
sysctl kernel.kptr_restrict=0
https://github.com/jvm-profiling-tools/async-profiler/wiki/Basic-Usage
And then run kotlin compiler with additional argument of
-Xprofile=<async-profiler-dir-path>/build/libasyncProfiler.so:event=cpu,interval=1ms,threads,start:<output-dir-path>
Note: output-dir must exist beforehand
And then provide files snapshot-*.collapsed
, it only contains JVM/Compiler stack-tracesvineethraj49
09/05/2022, 7:36 AMProfiler already started
am only able to get this for individual modules (-pl module
); as soon as it’s multi-module, or the module includes tests, this stops working..
any suggestions?semoro
09/05/2022, 9:14 AM-Dmaven.test.skip=true
to avoid compilation of tests
It is ok to collect it only for single module
Please collect it for that module, which is compiling significantly slower with K2
Also, does this build uses parallel building? If so, please disable it first