Android experiment that clarify dependency between amount of modules and incremental build time. You can find more details and results of this experiment here.
If in a single-module project one class is changed, gradle have to recompile the whole project.
Incremental build for a project with multiple modules is faster then for a single-module project, because only modified modules are recompiled while the rest — not.
Every branch will have it's own configuration. All configurations has around 90 000 methods splitted among 15 000 classes. Configurations are listed roughly in order they mentioned in the article.
- 1 module. Initial state.
- 3 modules. Code is equally split between 3 modules.
- 3 modules release conf. Code is equally split between 3 modules. But both debug and release versions of application depends on release versions of library modules.
- 5 modules. Code is equally split between 5 modules.
- 3 + 1 modules. Code is equally split between 3 library modules. Application module is tiny.
- 5 + 1 modules. Code is equally split between 5 library modules. Application module is tiny.
- 1 module without Annotation processors. The only configuration without Annotation Processors.
- 1 module API 21. Like initial state, but
minSdk
is 21. - 5 + 1 modules API 21. Exactly like 5 + 1 configuration, but
minSdk
is 21.
Below you can find final results for incremental build time. For best case it was reduced from 1m 10s to 17s. For more explanation please read the article.