For Kotlin users:
Incremental builds
One of the most important performance features of a compiler is its use of incremental compilation. A normal build will recompile all source files in a project, but an incremental build will keep track of which files have changed since the last build and only recompile those files and the files that depend on them. This can have a huge impact on compile times, especially for large projects.
Incremental builds were added to Kotlin in version 1.0.2, and you can enable them by adding
kotlin.incremental=trueto your gradle.properties…
See “Kotlin vs Java: Compilation speed” for more information.
Also adding this code to gradle.properties could be useful:
# Add this in your global gradle.properties file
# at ~/.gradle/gradle.properties
# Enable Gradle Daemon
org.gradle.daemon=true
# Enable Configure on demand
org.gradle.configureondemand=true
# Enable parallel builds
org.gradle.parallel=true
# Enable Build Cache
android.enableBuildCache=true
# Enable simple gradle caching
org.gradle.caching=true
# Increase memory allotted to JVM
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -
XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
And if all of your dependencies are downloaded from the repo center you can use this to make gradle offline form:
File->Setting->Build, Execution, Deploymennt->Gradle