Gradle is very slow with no reason

Hi -

I have a demo project with literally nothing in it.

I have a build.gradle with only 'task hello' in it. In other words a perfectly legitimate but useless build script.

When using the JetGradle task list to run the task it takes over 8 seconds! To do nothing!?

What is going on here, there is no call to the compiler, no packaging, nothing. I assume that it is just painfully slow in start up and tear down.

Is there a way to make gradle run faster?

thanks

4 comments

Hello,

Are there auto-generated thread dumps?

Could you provide a screencast which illustrates the problem?

Denis

0

Thanks - I have attached a file..

Hugh



Attachment(s):
thread-dump.txt.zip
0

Hi Hugh,

The dump you attached belongs to ide startup time. Are you sure that you made it when a gradle task was scheduled for execution?

Denis

0

Denis -

thanks for taking the time to look over it.

As it happens I have sorted the problem - I was not aware that gradle could be used in daemon mode.

For the sake of others reading this thread, if you experience multi-second startup time of gradle every time you run a task from within IDEA

add a gradle.properties files with "org.gradle.daemon=true". This will ensure the first time you run gradle it will fork a process and keep running in the background so future calls to gradle will not require expensive gradle loading.

more info here:

http://www.gradle.org/docs/current/userguide/gradle_daemon.html

0

Please sign in to leave a comment.