Build time - 5 minutes

Hi

My application is growing and now my buildtime goes around 5 minutes. Is this normal? How can I test if there is a bug that slows down the build process

I use a laptop with I7 processor, 16GB Ram, and SSD HDD

Thank you
George

Hi,

Is it clean build time or just repeatable build? Do you use web-toolkit module in the project?

Hi Yuriy

It’s repeatable build, I do not use web-toolkit module

Thank you

I’d recommend that you profile your build time with Gradle:

gradlew assemble --profile

It will generate high-level HTML file with duration for each build step plus dependency resolution time and start-up.

Usually, for repeatable builds you will see:

Description 	Duration
Total Build Time 	3.307s
Startup 	1.059s
Settings and BuildSrc 	0.006s
Loading Projects 	0.012s
Configuring Projects 	0.463s
Task Execution 	1.193s

Please note, that there is no need to run clean for repeatable builds. Gradle tracks changes automatically unlike Maven.

Thank you

with profiling it is actually faster…

mine looks like this:

Description Duration
Total Build Time 1m34.84s
Startup 6.224s
Settings and BuildSrc 0.800s
Loading Projects 0.323s
Configuring Projects 13.110s
Task Execution 1m13.06s
Dependencies Duration
All dependencies 1m2.33s
:app-core:compileClasspath 23.250s
:app-web:compileClasspath 16.586s
:app-global:compileClasspath 10.922s
:appComponent 5.211s
:classpath 4.707s
:app-web:provided 0.830s
:app-core:jdbc 0.412s
:app-core:provided 0.410s
:app-global:jdbc 0s
:app-global:provided 0s
:app-web:jdbc 0s
ask Duration Result
:app-web 31.173s (total)
:app-web:compileJava 21.871s
:app-web:processResources 3.461s
:app-web:webArchive 2.475s
:app-web:jar 2.206s
:app-web:sourceJar 1.066s
:app-web:buildScssThemes 0.091s UP-TO-DATE
:app-web:beansXml 0.002s UP-TO-DATE
:app-web:assemble 0.001s Did No Work
:app-web:classes 0s Did No Work
:app-core 27.729s (total)
:app-core:compileJava 26.277s
:app-core:dbScriptsArchive 0.488s
:app-core:assembleDbScripts 0.349s UP-TO-DATE
:app-core:jar 0.284s
:app-core:processResources 0.169s
:app-core:sourceJar 0.152s
:app-core:beansXml 0.010s UP-TO-DATE
:app-core:assemble 0s Did No Work
:app-core:classes 0s Did No Work
:app-global 12.101s (total)
:app-global:compileJava 10.986s UP-TO-DATE
:app-global:jar 0.362s
:app-global:processResources 0.346s
:app-global:sourceJar 0.195s
:app-global:buildInfo 0.126s
:app-global:enhance 0.077s UP-TO-DATE
:app-global:beansXml 0.007s UP-TO-DATE
:app-global:assemble 0.001s Did No Work
:app-global:classes 0.001s Did No Work
:app-web-themes 1.649s (total)
:app-web-themes:jar 1.082s
:app-web-themes:processResources 0.495s
:app-web-themes:beansXml 0.067s
:app-web-themes:compileJava 0.005s NO-SOURCE
:app-web-themes:assemble 0s Did No Work
:app-web-themes:classes 0s Did No Work
:app-gui 0.404s (total)
:app-gui:sourceJar 0.172s
:app-gui:jar 0.134s
:app-gui:processResources 0.090s
:app-gui:compileJava 0.005s NO-SOURCE
:app-gui:beansXml 0.003s UP-TO-DATE
:app-gui:assemble 0s Did No Work
:app-gui:classes 0s Did No Work
: 0s (total)

when I restart in Studio it take 3 min

BUILD SUCCESSFUL in 3m 10s
28 actionable tasks: 17 executed, 11 up-to-date

[12:16:04.201] Restarting the application server
[12:16:05.196] Executing Gradle tasks: deploy start
:app-core:assembleDbScripts UP-TO-DATE
:app-core:dbScriptsArchive
:app-core:beansXml UP-TO-DATE
:app-global:beansXml UP-TO-DATE
:app-global:processResources UP-TO-DATE
:app-global:buildInfo
:app-global:compileJavaNote: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:app-global:enhance
:app-global:classes
:app-global:jar
:app-core:compileJava
:app-core:processResources UP-TO-DATE
:app-core:classes
:app-core:jar UP-TO-DATE
:app-core:sourceJar UP-TO-DATE
:app-core:assemble
:app-core:cleanConf
:app-core:deploy
:app-web:buildScssThemes UP-TO-DATE
:app-web:beansXml UP-TO-DATE

:app-gui:beansXml UP-TO-DATE
:app-gui:compileJava NO-SOURCE
:app-gui:processResources UP-TO-DATE
:app-gui:classes UP-TO-DATE
:app-gui:jar UP-TO-DATE
:app-web:compileJavaNote: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:app-web:processResources UP-TO-DATE
:app-web:classes
:app-web:jar
:app-web:sourceJar
:app-web:webArchive UP-TO-DATE
:app-web:assemble
:app-web:cleanConf
:app-web:deploy
:start

BUILD SUCCESSFUL in 3m 27s
28 actionable tasks: 14 executed, 14 up-to-date

All dependencies 1m2.33s

It could be network problem with dependency resolution. Set off-line in Settings and try again. Or from CLI:

gradlew deploy --profile --offline

Did you clean sources before build?

Because compileJava is not marked as UP-TO-DATE

:app-core:compileJava

Usually, deploy just takes 10 sec if project is compiled:

Task 	                    Duration 	Result
:refapp-core 	            4.217s 	(total)
:refapp-core:deploy 	    3.881s 	
:refapp-core:compileJava    0.195s 	UP-TO-DATE

One more option to figure out what is wrong: Redirecting to https://docs.gradle.org/current/userguide/performance.html

gradlew deploy --scan

Please note that it will publish your results to the Gradle Inc cloud.

I’ve checked our biggest projects and they have approximately 5 minutes clean build. And only 20-30 seconds for repeatable redeploy even on laptop without SSD and i5 processor.

It could be problem with Gradle or Network, I believe that investigation and profiling will show something.

Also, I’d recommend checking options of your anti-virus if you use it and add ~/.gradle directory to exceptions

Hi
I have cleaned my build.gradle … there were some broken repositories … I cleaned and now it compiles in 7s.
Thank you!