I read this blogs and it explain all possible things which will help you to make build process faster.
First:
Gradle scripts directory(i.e., ~/.gradle/gradle.properties)
`# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
org.gradle.parallel=true
When set to true the Gradle daemon is used to run the build. For local developer builds this is our favorite property.
The developer environment is optimized for speed and feedback so we nearly always run Gradle jobs with the daemon.
org.gradle.daemon=true`
Second :
Incease dex and heapsize
dexOptions {
incremental true
javaMaxHeapSize "3g"
}
Third:
Also try to set gradle parameters in the settings file by increasing the max heap size in case you have a large project:
`# Specifies the JVM arguments used for the daemon process.
The setting is particularly useful for tweaking memory settings.
Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8`
For more details you can refer this link.