Stylianos Gakis
11/17/2024, 12:22 AM--scan exists which is probably where I should go to start comparing, but how can I get a true clean build, so that the two builds I will be comparing are actually comparable in a fair way?
What I tried so far is:
• Checkout the branch.
• Sync project.
• Run ./gradlew clean
• Run ./gradlew buildDebug --scan
Did this to both of my branches, and I thought the build looked comparable, but then I did it again with another branch and the build then was not comparable at all. The first two builds were 4 minutes, and 3.30 minutes respectively. The third run was 1 minute.
So I feel like I am definitely missing something. Any tips here?Vampire
11/17/2024, 12:39 AMclean or it would be senseless. 🙂Vampire
11/17/2024, 12:39 AMgradle-profilerStylianos Gakis
11/17/2024, 12:47 AMVampire
11/17/2024, 1:46 AMGRADLE_USER_HOME in addition for each run for example.Jason Pearson
11/17/2024, 2:04 PM--rerun-tasks --no-build-cache --no-configuration-cache to ensure you're doing the same exact clean buildStylianos Gakis
11/17/2024, 2:43 PM./gradlew --stop before each run, or would that be useless?
I am not doing any super high quality comparisons or building dashboards here btw, just want to get a ballpark of approx how much what I am doing helps or not.Vampire
11/17/2024, 2:48 PM--rerun-tasks, --no-build-cache is pointless.
Also doing clean is kind of pointless, yes.
Which flags to use or whether to clean or use a clean gradle user home or whether to stop the daemon all majorly depends on what exactly you want to compare.
For example, if the optimizations you do are really in the work the tasks are actually doing, --rerun-tasks should be fine, stopping the daemon in-between the runs ensures the daemon is started on each run and so eleminates the difference from starting the daemon, but you could also simply add --no-daemon which nowadays usually mean to always start a one-off daemon that is shut down after the build execution.
If the optimizations for example are for more reliably being up-to-date or for having tasks cacheable, then those options are more counter productive for the comparison, ...Stylianos Gakis
11/17/2024, 2:59 PMJason Pearson
11/18/2024, 12:55 AM--rerun-tasks by itself Gradle could still fetch the build cache but would still ignore any hits? That would add noise to comparisons that seek to eliminate sources of variance between builds.Vampire
11/18/2024, 4:28 PMJason Pearson
11/18/2024, 5:32 PMStylianos Gakis
11/19/2024, 8:55 AMJason Pearson
11/19/2024, 8:57 AMStylianos Gakis
11/19/2024, 8:57 AMJason Pearson
11/19/2024, 9:04 AM