Oh! #Gradle, Why so slow?
Submitted by Arun Babu A S P (@arunbabuasp) on Wednesday, 10 August 2016
Section: Full talk (40 minutes) Technical level: Advanced
Abstract
This talk will cover various measures that can be taken to improve the build speed. Starting from obvious tips, will quickly jump into more advanced options which worked beautifully for the large project that produces Dailyhunt app. As part of the process, various ways to measure time taken by different tasks will also be discussed.
Outline
Gradle configurations
- Daemon enabled - Parallel execution - Configuration on demand - Build cache (new guy in town) - Large heap allocation
Leveraging dex options properly
- dexInProcess enabled - javaMaxHeapSize & maxProcessCount - preDexLibraries (slower clean build)
Instant run (For debug config)
- Set minSdkVersion as 21 - Disable proguard - Disable Windows defender for project folder - Disable crashlytics & other plugins
Module management
- settings.gradle for dev - Modules included as aar - Modules included as no-op - Independent modules with DI
Measuring speed
- --profile - Build scan plugin - Build time tracker plugin
More weapons (For dev setup)
- Disable tasks with name "Test" - Try JACK tool chain - SSD for project folder - RAM disk for project folder
Requirements
Android developer, a victim affected by slow android build
Speaker bio
- Arun Babu A S P, Architect (Android) with more than 10 years of experience building mobile apps
- https://in.linkedin.com/in/arunasp
- https://yourstory.com/2016/09/arun-babu-story/