I have been able to get some pretty amazing compilation time for Kotlin on Android. I disabled Instant Run in Settings and uncommented the following line in gradle.properties: org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
and changed 2048 to 4096. I also went into app/build.gradle and added the following lines under:
Mind you, this is a second generation i5 mobile processor at 2.4 ghz and 6 gigs of RAM, 4 year old laptop. I didn’t experience any slowdown in performance and I have seen that Gradle doesn’t use the allocated heap of 4 gigs, so no issues there.