Very slow Gradle builds

I know that language: java is not supported yet, but the Windows environment does have gradle and jdk8, so I’ve been trying it out. It works pretty well, but the biggest thing I’ve noticed is that it’s very slow. Here are the timings for the same build on Windows, Linux and OSX:

Windows
gradlew assemble: 421 seconds
gradlew check: 150 seconds
store build cache: 496 seconds
total time: 23 min 53 seconds

Linux
gradlew assemble: 49 seconds
gradlew check: 66 seconds
store build cache: 79 seconds
total time: 4 min 25 sec

OSX
gradlew assemble: 88 seconds
gradlew check: 106 seconds
store build cache: 129 seconds
total time: 7 min 7 sec

Here’s the link to the build: https://travis-ci.com/klazuka/intellij-elm/jobs/154711116

Is there anything I can try changing in my config to get faster builds on Windows? Maybe I should disable the caching?

1 Like

Same observation when building JUnit 5: on Travis Windows, the build takes 3-5 times longer.

https://travis-ci.org/junit-team/junit5/builds/444164289

I don’t think that caching is the issue. Seems to me the (virtual) processor power is limited.

Windows builds are just slow in general, it doesn’t seem to be related to some specific software.

For example here’s nodejs/yarn where Windows is 4 times slower: https://travis-ci.com/thelounge/thelounge/builds/91194239

Disabling the windows defender is helping a bit. Always use this with

os: windows

before_install:
    - powershell -command 'Set-MpPreference -DisableRealtimeMonitoring $true'
2 Likes