Builds slower with daemon than without

Hi,

Recently my company upgraded to gradle 5.2.1. The version used before was 2.9.

We made some tests in order to use gradle daemon, but we got very “strange” results:

Following are the results using gradle 5.2.1:

Run Sequential Sequential + Daemon Parallel Parallel + Daemon
#1 12m 58s 12m 40s 6m 16s 6m 3s
#2 12m 33s 12m 43s 5m 49s 7m 29s
#3 12m 45s 13m 45s 5m 49s 7m 6s

In theory the daemon exists to the subsequent builds be faster and our case is slower than not using the daemon. I wish to know if we are doing something wrong.

Important notes:

  • I ran ./gradlew clean build in the all cases
  • In the dameon cases, after I ran all sequential tests I had stopped the daemon to make a fresh start for the parallel tests.
  • In parallel runs the max workers are 4.
  • We have a very large setup which our main gradle has 88 subprojects.
  • We have some gradle plugins in order to things like generate some DTO classes based on our interface and also generate our wsdl interface.
  • Sometime when using the daemon we got very bad results for build (around 20 minutes)

So it looks like that there is something that is affecting the daemon behavior. We would like to know if you guys have any ideas how we could trace down the root cause of this.

Thanks in advance