Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use all CPU cores/threads when running Android Studio gradle build?

I'm looking for a parameter or configuration in Android Studio / Gradle, that can set the build so it will use all of my CPU cores during build time. i.e. If I have a quad-core CPU and each core is running 8 threads, how can I optimize the build so it will use every resource it could get (parallel of course)?

Thank you!

like image 275
ori888 Avatar asked May 28 '15 12:05

ori888


People also ask

Does Android studio use multiple cores?

So android studio and mostly gradle compiler do use all available CPU cores and threads during compilation.


1 Answers

in the local.properties file in my project I have

org.gradle.daemon=true org.gradle.parallel=true org.gradle.configureondemand=true 

additionally you can specify

org.gradle.parallel.threads 

which specifies the maximum number of threads to use for parallel execution. it needs org.gradle.parallel=true. Here you can find more information about it

like image 76
Blackbelt Avatar answered Oct 13 '22 23:10

Blackbelt