Before you begin tuning your Gradle build for performance, you should establish a baseline and figure out which portions of the build are taking the most time. To do this, you can profile your build by adding the
--profile argument to your Gradle command:
gradle --profile ./gradlew --profile
After the build is complete, you will see an HTML profile report for the build under
./build/reports/profile/, looking something like this:
By clicking on the tabs next to Summary, you can see a more-detailed breakdown of where time is spent.