When I execute gradle sometimes it takes very long to "Initzialize" (up to 40 seconds).
PS C:\Users\Username\project> gradle build
<------------> 0% INITIALIZING [35s]
> IDLE
It doesn't seem to matter what goal I try to execute (compileJava
, test
and build
all take this long)
If I re-run Gradle shortly after it took so long it's very quick and executes in a matter of milliseconds or seconds but if I wait longer to re-run, it again takes very long.
This happens to me in different projects and it happens with gradlew
and also with gradle
.
I'm on Windows 10 and I use Gradle 7.4.
compileJava
is part ofbuild
, andtest
depends onbuild
, so if e.g.,compileJava
is slow, the others are slow, too, as they need to runcompileJava
. Have you tried running with--profile
to get more information? Or--parallel
to speed things up? – Mccue--parallel
did not result in a significant performance improvement. See this scan for performance details: scans.gradle.com/s/vpdk72ozzv73m/performance/build For comparison see this performance scan when I re-run gradle right after it taking a long time (as described in the question): scans.gradle.com/s/3rts7cpwy2o4w/performance/build As you can see there is a dramatic performance improvement. – Chine