This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 220995

Summary: Graph tab is blocking the AWT on graph layouting
Product: projects Reporter: crazyjavahacking
Component: MavenAssignee: Milos Kleint <mkleint>
Status: RESOLVED FIXED    
Severity: normal CC: esche, FrantaM, jglick, jtulach, ma.schroed, markiewb, misterm, myshkin, panason2008, pekarna, uwe_pachler, yoosiba
Priority: P3 Keywords: PATCH_AVAILABLE, PERFORMANCE, THREAD
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 161429
Attachments: Maven project to reproduce
nps snapshot
nps snapshot
Proposed patch

Description crazyjavahacking 2012-10-29 08:58:38 UTC
Created attachment 126698 [details]
Maven project to reproduce

Graph tab is still blocking the whole UI even if there wasa fix to execute the graph creation outside EDT (I think using RequestProcessor).

The more dependencies would need to be processed, the longer the slowness would take.

Easily reproducible with standard Maven Java SE project with Atlassian JIRA dependency. See http://screencast.com/t/bHkmhogFftc.


NetBeans Dev 201210280001, JDK 6u34 32bit
Comment 1 Milos Kleint 2012-10-29 14:03:18 UTC
cannot resist to note that the slowness bubble that appeared in your video and that you closed, when clicked provides fairly good way of reporting slowness bugs. It even provides you with automated way of reporting issues..
Comment 2 Milos Kleint 2012-10-29 14:14:04 UTC
besides,  atlassian-jira is not in central, what repository is it in?
Comment 3 crazyjavahacking 2012-10-29 15:06:06 UTC
Sorry, I just have repositories in my setting.xml and I forget to check it.

You can find the public Atlassian Repository and Jira atrifacts at https://maven.atlassian.com/content/groups/public/com/atlassian/jira/atlassian-jira/
Comment 4 Milos Kleint 2012-10-29 15:31:02 UTC
*** Bug 220996 has been marked as a duplicate of this bug. ***
Comment 5 Milos Kleint 2012-10-29 15:33:00 UTC
the problem lies in the layout algorithm that is slow to iteratively relayout large trees. Cannot be just posted to non-AWT thread.
Comment 6 Milos Kleint 2012-10-29 15:53:18 UTC
when I click the bubble slowness popup and file the slowness on the server, I get to this  issue 185319 which claims it's likely a jdk problem. but that supposed to be already fixed.
Comment 7 Milos Kleint 2013-01-04 07:48:47 UTC
*** Bug 224396 has been marked as a duplicate of this bug. ***
Comment 8 Jesse Glick 2013-02-01 16:31:02 UTC
Maybe there is some way to show the graph incrementally, i.e. displaying the dependencies closest to the project first, then adding in some transitive dependencies, then another batch, etc.? With the idea that if the rendering gets slower each time, at least you would have the chance to switch to a different tab before you are completely screwed.
Comment 9 myshkin 2013-02-16 15:28:53 UTC
Created attachment 131455 [details]
nps snapshot

Saving Snapshot
WARNING [org.netbeans.core.TimableEventQueue]: too much time in AWT thread org.netbeans.modules.sampler.InternalSampler@c3c6c4
Comment 10 Exceptions Reporter 2013-02-26 12:26:15 UTC
Created attachment 131890 [details]
nps snapshot

just open "graph" view in pom.xml
Comment 11 Jesse Glick 2013-06-03 17:34:18 UTC
This is such a constant annoyance I think _something_ needs to be done about it. Possibilities:

1. Incremental display as in comment #8.

2. Move the graph tab to a separate plugin (preferably on AU) so you can turn it off.

3. Show nothing in the tab by default, just a label warning you that layout can be very expensive and a button confirming that you want to proceed.

Another issue is that the graph is redisplayed if the POM is reloaded, e.g. if you save some changes; and this happens even if the graph tab is not currently displayed! Instead the graph tab should just show a warning label that it is out of date, and give you a button to refresh it.
Comment 12 Jesse Glick 2013-08-22 16:29:57 UTC
Ongoing problem for people like me with projects with deep dependency graphs. Would you accept a patch e.g. for option #3 (which seems the simplest one)?
Comment 13 Milos Kleint 2013-08-23 06:43:51 UTC
(In reply to Jesse Glick from comment #12)
> Ongoing problem for people like me with projects with deep dependency
> graphs. Would you accept a patch e.g. for option #3 (which seems the
> simplest one)?

yes
Comment 14 Jesse Glick 2013-08-23 13:12:20 UTC
Created attachment 139138 [details]
Proposed patch

Attached patch just adds a button ‘Show Graph’ to the start of the toolbar. When the tab is opened, initially nothing is shown; this prevents the IDE from freezing just because you are cycling through tabs or looking around. If and when you click the new button, the graph is displayed (which can still freeze for a while). If the model changes subsequently, the stale graph is hidden and a different label is displayed; you can choose to click the button to show a new graph, but if you do not, no work is done, so there is no performance overhead to editing dependencies etc. after having once shown the graph.
Comment 15 Milos Kleint 2013-08-23 14:27:55 UTC
the patch looks good, just one UI comment,
why did create a toolbar button instead of adding the button to the text that appears in the middle of the view?
Comment 16 Jesse Glick 2013-08-23 17:27:09 UTC
The button could have been added to the label in the middle of the view, I just thought it would look odd. If you would prefer it that way, it should be easy enough to implement.
Comment 17 Milos Kleint 2013-08-27 14:19:14 UTC
(In reply to Jesse Glick from comment #16)
> The button could have been added to the label in the middle of the view, I
> just thought it would look odd. If you would prefer it that way, it should
> be easy enough to implement.

on second thought, maybe it's better to have it at well defined place.
Comment 18 Milos Kleint 2013-08-27 14:43:14 UTC
I will integrate the patch with the UI "as is" however I'd like to experiment with setting some complexity boundary on the button to appear. Eg. when the number of maven dependencies is greater than 20.
Comment 20 Quality Engineering 2013-08-29 01:43:14 UTC
Integrated into 'main-silver', will be available in build *201308290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/586d0279e33c
User: Milos Kleint <mkleint@netbeans.org>
Log: #220995 for complex dependency trees don't show the graph immediately, only on user's request