Maria Krishtal
08/02/2023, 3:26 PMYoussef Shoaib [MOD]
08/02/2023, 3:30 PMMarc Reichelt
08/02/2023, 4:19 PM-Pkotlin.experimental.tryK2=true
flag
• okhttp_different_branches.scenarios if you have K2 enabled on a different branch, and you want to benchmark 2 different Git branches
Happy K2'ing! 🎉Sebastian Aigner
08/02/2023, 4:39 PMdewildte
08/02/2023, 4:46 PMManuel Bogner
08/02/2023, 5:16 PMMarc Reichelt
08/03/2023, 9:28 AMManuel Bogner
08/03/2023, 9:50 AMMarc Reichelt
08/03/2023, 11:30 AMbrew install gradle-profiler
), save this as your k2.scenarios
file:
default-scenarios = ["without_k2", "with_k2"]
without_k2 {
title = "Without K2 compiler"
cleanup-tasks = ["clean"]
tasks = ["compileKotlin"]
gradle-args = ["--no-build-cache"]
}
with_k2 {
title = "With K2 compiler"
cleanup-tasks = ["clean"]
tasks = ["compileKotlin"]
gradle-args = ["--no-build-cache", "-Pkotlin.experimental.tryK2=true"]
}
Then you can run the benchmark like this in your project directory:
gradle-profiler --benchmark --scenario-file k2.scenarios
Hope this helps!Manuel Bogner
08/03/2023, 12:31 PMManuel Bogner
08/03/2023, 12:31 PMManuel Bogner
08/03/2023, 12:50 PMMarc Reichelt
08/03/2023, 12:50 PMMarc Reichelt
08/03/2023, 12:51 PMManuel Bogner
08/03/2023, 1:01 PMManuel Bogner
08/03/2023, 1:02 PMMarc Reichelt
08/03/2023, 1:04 PMbuild
task will of course also run all checks and tests, so in the first benchmark we actually compared how fast the build & running the tests is. And the Spring Boot tests of course take a lot of time 😅
Now we used compileKotlin
to run the benchmark and we got some good results 👍Marc Reichelt
08/03/2023, 1:04 PMColton Idle
08/04/2023, 12:07 AM.scenarios
file you were using?Manuel Bogner
08/04/2023, 1:04 AMManuel Bogner
08/04/2023, 1:04 AMdefault-scenarios = ["without_k2", "with_k2"]
without_k2 {
title = "Without K2 compiler"
cleanup-tasks = ["clean"]
tasks = ["compileKotlin"]
gradle-args = ["--no-build-cache"]
}
with_k2 {
title = "With K2 compiler"
cleanup-tasks = ["clean"]
tasks = ["compileKotlin"]
gradle-args = ["--no-build-cache", "-Pkotlin.experimental.tryK2=true"]
}
Colton Idle
08/04/2023, 1:30 AMManuel Bogner
08/04/2023, 6:52 AMgroostav
08/22/2023, 4:12 PM