On 22/06/2011, at 8:58 AM, M A wrote:

> Hi all,
> 
> My gradle build is eating almost 30 seconds even before it considers
> executing any tasks. How do I best go about diagnosing the problem?

A common problem is accidentally resolving dependencies at configuration time, 
rather than at execution time. This can make the configuration phase quite 
slow, particularly if those dependencies include dynamic revisions or snapshots.

The profiling report does not yet give you any information about how long 
dependency resolution takes, or where in the build it happens. We do want to 
add this at some point.

What you could do in the meantime is comment out all the dependencies 
(temporarily, of course), and see if this has an effect on the execution time 
for, say, 'gradle help'.


> 
> Cheers,
> Merlyn
> 
> =========== details ============
> 
> When I run this command:
> 
> gradle --profile tasks
> 
> Here's the output:
> 
> Summary
> Total Build Time      33.494
> Startup       1.268
> Settings and BuildSrc         0.617
> Loading Projects      0.539
> Configuring Projects  28.697
> Total Task Execution  1.649
> 
> When I run in debug mode
> 
> gradle -d tasks
> 
> Then I get 33890 lines of output, of which 33456 are IvyLoggingAdapter.
> 
> I noticed the log messages of the form "took XX secs". 223 lines
> mention "secs". These are the ones that are 0.1 seconds or greater:
> 
> 15:41:34.253 [DEBUG]
> [org.gradle.initialization.ScriptEvaluatingSettingsProcessor] Timing:
> Processing settings took: 0.665 secs
> 15:41:34.761 [DEBUG] [org.gradle.initialization.BuildLoader] Timing:
> Loading projects took: 0.506 secs
> 15:41:40.091 [DEBUG] [org.gradle.configuration.BuildScriptProcessor]
> Timing: Running the build script took 5.323 secs
> 15:41:40.860 [DEBUG] [org.gradle.configuration.BuildScriptProcessor]
> Timing: Running the build script took 0.125 secs
> 15:41:41.031 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultSettingsConverter]
> Timing: Ivy convert for resolve took 0.136 secs
> 15:41:42.976 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.moduleconverter.ResolveModuleDescriptorConverter]
> Timing: Ivy convert for resolve took 1.328 secs
> 15:41:42.985 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.moduleconverter.PublishModuleDescriptorConverter]
> Timing: Ivy convert for publish took 1.337 secs
> 15:41:45.892 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.moduleconverter.ResolveModuleDescriptorConverter]
> Timing: Ivy convert for resolve took 1.046 secs
> 15:41:45.896 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.moduleconverter.PublishModuleDescriptorConverter]
> Timing: Ivy convert for publish took 1.05 secs
> 15:41:47.291 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 4.305 secs
> 15:41:47.406 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyReportConverter]
> Timing: Translating report for configuration configuration
> ':PATH:SOMEPROJECT' took 0.103 secs
> 15:41:49.120 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.849 secs
> 15:41:50.230 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.42 secs
> 15:41:51.287 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.401 secs
> 15:41:52.599 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.491 secs
> 15:41:53.646 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.391 secs
> 15:41:54.909 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.465 secs
> 15:41:56.088 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.509 secs
> 15:41:57.078 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.334 secs
> 15:41:57.384 [DEBUG] [org.gradle.configuration.BuildScriptProcessor]
> Timing: Running the build script took 0.134 secs
> 15:41:58.419 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.602 secs
> 15:41:59.438 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.259 secs
> 15:42:00.682 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 0.649 secs
> 15:42:02.780 [DEBUG]
> [org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver]
> Timing: Ivy resolve took 1.092 secs
> 15:42:03.777 [DEBUG] [org.gradle.configuration.BuildScriptProcessor]
> Timing: Running the build script took 0.764 secs
> 15:42:03.954 [DEBUG] [org.gradle.configuration.BuildScriptProcessor]
> Timing: Running the build script took 0.168 secs
> 15:42:05.832 [DEBUG] [org.gradle.execution.DefaultTaskGraphExecuter]
> Timing: Executing the DAG took 1.188 secs
> 15:42:05.834 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 33.536 
> secs
> 
> I'm using Gradle 1.0-milestone-3.
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>    http://xircles.codehaus.org/manage_email
> 
> 


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to