Colton Idle
03/27/2025, 1:05 PMgradle-profiler
to profile some of my gradle tasks. Specifically I want to see how gradle configuration is affected by the config-cache-parrellel=true
(since it is being enabled by default in 8.11).
Is there a way to write a gradle profiler scenario for just running configuration?
Should I just run the help
task?Anze Sodja
03/27/2025, 1:41 PMtasks
is better for such testing, help
configures very little. If you want to focus on some specific task maybe using --dry-run
can help too.
Note: configuration-cache-parallel is not enabled by defaultColton Idle
03/27/2025, 6:05 PMColton Idle
03/27/2025, 6:06 PMColton Idle
03/27/2025, 6:53 PMscenario {
tasks = ["tasks"]
gradle-args = ["--rerun-tasks"]
}
and turning on the parallel flag basically makes no difference. Theres a P75 of like 100ms vs 105ms.
Open to ideas if there's anything else that does a better "test" of gradle configuration time.Anze Sodja
03/28/2025, 8:16 AMColton Idle
03/28/2025, 3:43 PMclear-configuration-cache-state-before
and it seems to make a difference. I can see now that configuration phase is about 7 seconds for my app while running help task. Running "tasks" task takes about 10 seconds. but I guess "help" task is closer to finding configuration time vs tasks task which might be "execution" time?Mikhail Lopatkin
03/28/2025, 4:01 PMtasks
and help
is printing the output to the console.
tasks
eagerly configures all tasks in the project, while help
doesn't, so the former is slightly more representative.
And, I think, neither is going to be particularly representative for the parallel CC, because Gradle shards storing the tasks per project. I.e. you need to have a multi-project build and tasks from many projects in the graph to see the difference.Colton Idle
03/28/2025, 4:07 PMconfiguration {
tasks = ["help"]
}
I got that from this article from tony R https://dev.to/autonomousapps/benchmarking-builds-with-gradle-profiler-oa8
Or (since i have config cache enabled already) would I need to run?
configuration {
tasks = ["help"]
clear-configuration-cache-state-before: BUILD
}
Mikhail Lopatkin
03/28/2025, 6:51 PM