-
Notifications
You must be signed in to change notification settings - Fork 108
Very slow in large multi-projects #82
Comments
👍 with 300+ projects Additionally, almost every time I update the code, many eclipse projects fall apart: lose gradle nature, get inexplicable compilation errors, lose previously known source folders... Practically, the only solution is to reimport everything which is a huge pain. I'm trying to put together an example project. One of the major issues seems to be when an already imported module is deleted. |
Great, a sample would help a lot, otherwise I wouldn't know where to start debugging it. |
I'll provide you with profiling results tomorrow. Evaluating 500+ projects has gone from seconds to minutes from the 2.9.1.xx-201408111402-e44 and now. I ran JMC Java Flight Recorder and most time was spend in hash maps. Will get back with details. |
Are these projects part of a single multi-project build? Or separate Have you tried mucking around with some of the new options My suspicion is that model builds take more time because, unfortunately we At/near the end of the thread... We should really use 'BuildActions' to build all these 'little models' at On Tue, Feb 10, 2015 at 12:15 PM, abrolle notifications@github.com wrote:
|
All projects are part of the same multi-project build. No maven or other jar repo dependencies, only pure project dependecies. |
I read the discussion you refered to on gradle forums. I would be great to introduce the 'BuildActions' approach. However my 500+ projects work fine with the 2.9.1.xx-201408111402-e44 version. Something must have been done between then and now to make it much slower. |
Indeed, before we only used 'EclipseProject' model from Gradle and this can be built for all projects in a multiproject in one go. In current version of Gradle there are also some other models being used which, unfortunately don't allow this kind of 'bulk' building of models. I am almost certain this has something to do with your slow down where you are now hvaing to build '500 little models' instead of a single big one. Some of these changes can be disabled in the preferences which I asked you to try. But I think there are some changes also in the task models which can not be disabled. They were introduced to allow for identification of public tasks and fix some problems with the task models. You could try doing an import of your projects and disabling any execution of tasks during the import, it may be your projects then do not import correctly, but it might reveal if building the tasks models is what's slowing things down. |
When it comes out we will probably update to its tooling API, but it doesn't help with the BuildActions issue since the problem is not in the tooling API itself but in the Gradle version that people use. This means we still cannot use BuildActions until everyone has switched to Gradle 2.3. |
Did you have Gradle Tasks view opened? Did you use Quick Tasks Launcher or “Gradle Build” external tools launch config wizard? Now, I’ve noticed that you’re talking about "importing and refreshing gradle tasks”… Gradle tasks can be refreshed in the Gradle Tasks view. Only Gradle projects can be imported though… My guess it’s the project import/refresh being slow, correct? Is that annoying because the UI is blocked at that time?
|
I ran the import again with the 'Gradle Tasks View' closed. This made the import go quicker. The external tools launch config wizard is not something we use. We have so many projects and mapping specific gradle tasks with this one would take quite some time. The normal java projects have no specific tasks. For applications we have specific packaging and install tasks we want to execute. I should have been clearer in my desciption. Meant: "Importing projects" and "Refreshing tasks in the gradle tasks view". The problem with import being slow is the we are not working in a fixed project structure. New projects are added and dependencies are changed. When 10+ projects have updated dependencies the normal approach has been to reimport the projects again. This takes time. Do you have a better suggestion on how to approach this situation? |
Sounds like the changes in how task models are computed are responsible for your troubles.
Alex would know this better than me, maybe the quicklauncher builds different (old-style) task model so is not affected by the slow down.
Selecting all the projects and doing 'Refresh All' or 'Refresh Dependencies' might work better, but I suspect it will be prone to the same problem. Plus that might not be as convenient if new projects have been added. |
Thinking some more about what might be going on. So... having tasks view open slows down import. Probably its the 'many little model builds' the task viewer creates to build task models are holding up the model builds required for importing project. Effectively only one model can be 'building' at the same time. If task models are building for several minutes (not too surprising if there's 100s of them to build) then it would delay the model builds for import. |
I have tried Spring-XD code base: https://github.com/spring-projects/spring-xd with STS 3.6.3 (Gradle 3.6.3) and STS 3.6.0 (Gradle 3.6.0). |
I will try this. Is there any chance the slowdown I'm seeing is caused by the fact that we are applying the eclipse plugin to each subproject? We are using this to assign each subproject a unique name: group + '.' + name. |
I am experiencing the same issue. I have only enabled the Use Custom Tooling Model preference. |
Disable the custom tooling model and the problem should be solved. This is a known issue and there's nothing we can do about it. There is a more efficient way of building the model but unfortunately a bug in Gradle prevents us from using it as it doesn't work in OSGI environment. |
Also, I beleave that, being aware of how long it takes to refresh these models, I did my best to implement the refresh in such a way that it all happens in a background and shouldn't block you from continuing to work. |
@kdvolder Thank you for your quick response! Do we have an estimation of when the bug in Gradle will be fixed? It it registered in the issues tracker? |
The bug is fixed in the Gradle version 2.3. However, the problem is this that we still can't practically use it because, if we do, then we must either:
Neither of these are good options for us as the former is not reasonable to many users and the latter is a maintenance nightmare for us. So, this means we are stuck with this implementation until Gradle 2.2 no longer matters to most users. The discussion is here: |
I am working on a project with 500+ eclipse projects. The eclipse-integration-gradle plugin runs ok on version 2.9.1.xx-201408111402-e44. I have tried different later versions but all are getting extremely slow, both import and refresh of gradle tasks. Latest version from http://dist.springsource.com/snapshot/TOOLS/gradle/nightly tried today.
Running on eclipse 4.4.0 using gradle 2.2.1.
The text was updated successfully, but these errors were encountered: