Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Gradle Performance Scale Well With Number Of CPU Cores

Curious if gradle build performance scales proportionally to CPU cores.

Considering single higher clocked vs dual Xeon workstation upgrade for gradle wrapper builds via Android Studio

Wondering if it's worth it considering I'm not bottlenecked by disk IO?

like image 385
AlexVPerl Avatar asked Dec 11 '15 07:12

AlexVPerl


1 Answers

Currently there are two ways Gradle can utilize multiple CPU cores:

  • Parallel build exection
  • Parallel test execution

Parallel build execution only works on multi-project builds with decoupled projects and can be activated with --parallel on the command line. See https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:parallel_execution for more information.

Parallel test execution can be activated by setting maxParallelForks in a test task. See https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html

You should also be aware of Configuration on demand for large multi-project builds: https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:configuration_on_demand

So I'd say yes, Gradle performance scales well with multiple CPU cores.

like image 188
tomasulo Avatar answered Sep 18 '22 12:09

tomasulo