Ok, I run another ./gradlew assemble --info
- this time, I changed one line in the code - that’s the actual problem. Of course, during development you change code and start again. The output now is more accurate:
:bootBuildInfo (Thread[Execution worker for ':',5,main]) completed. Took 0.007 secs.
:compileKotlin (Thread[Execution worker for ':',5,main]) completed. Took 30.098 secs.
:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 10.273 secs.
:processResources (Thread[Execution worker for ':',5,main]) completed. Took 0.042 secs.
:classes (Thread[Execution worker for ':',5,main]) completed. Took 0.009 secs.
:bootJarMainClassName (Thread[Execution worker for ':',5,main]) completed. Took 0.324 secs.
:bootJar (Thread[Execution worker for ':',5,main]) completed. Took 2.134 secs.
:inspectClassesForKotlinIC (Thread[Execution worker for ':',5,main]) completed. Took 0.04 secs.
:jar (Thread[Execution worker for ':',5,main]) completed. Took 0.284 secs.
:assemble (Thread[Execution worker for ':',5,main]) completed. Took 0.001 secs.
That’s still not more than ~43 seconds with the assemble task.
If I run bootRun
though, the gradle tasks take ~1 minute.
12:06:25: Executing task ' bootRun'...
...
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.5.5)
2021-11-19 12:07:24.009 INFO 291561 --- [ main] c.i.MyApplication$Companion : Starting MyApplication.Companion using Java 11.0.11 on ... with PID ...
...
2021-11-19 12:07:39.561 INFO 291561 --- [ main] com.i.MyApplication : Application started at http://localhost:8080
That says it’s ~ 1min 15sec for serving the first request.
My best bet is probably to try to optimize the kotlin compilation process. Any ideas?