is there a way to profile the compiler compile tas...
# compiler
b
is there a way to profile the compiler compile task to see what exactly takes the most time?
r
Gradle build scans might be helpful. Otherwise I would think you can use
-Dkotlin.compiler.execution.strategy="in-process"
and profile it (or the gradle task) like a standard JVM process, since it is one. Or perhaps attach a profiler to the daemon, you can pass JVM args like
org.gradle.jvmargs=-Xmx8g -Dkotlin.daemon.jvm.options=-Xmx6g
s
There is an advanced compiler option
-Xreport-perf
report detailed performance statistics
b
Thanks, will try these out. Build scans by default just display which modules take most time, but I wanted to know what exactly in those modules is taking so long. Will use above suggestions.
d
You also can profile kotlin daemon. To pass jvm args to daemon you need to 1. Manually kill all daemon processes 2. Run some gradle task and pass jbm args using
-Dkotlin.daemon.jvm.options
3. Run all other gradle tasks without that arg (otherwise it will create new daemon for each run) Example of options for opening debug port in daemon:
./gradlew -Dkotlin.daemon.jvm.options="-agentlib:jdwp=transport=dt_socket\\,server=y\\,suspend=n\\,address=5005" <task-to-execute>