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 119999 - Flow: slow routing algorithm
Summary: Flow: slow routing algorithm
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker with 1 vote (vote)
Assignee: issues@platform
URL:
Keywords: PERFORMANCE
: 130233 (view as bug list)
Depends on:
Blocks: 183568
  Show dependency tree
 
Reported: 2007-10-25 09:59 UTC by lauri
Modified: 2010-11-04 04:12 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lauri 2007-10-25 09:59:26 UTC
hi,

COllapse all and expand all functions are very slow when there are around 40 forms in design.

Also it seems that repeating those few times make operation slower. No timing done on this, but when repeated I first
thought NB died completely, as it too so long.

regards
Lauri
Comment 1 David Kaspar 2007-10-25 10:16:08 UTC
This is not caused by the collapsing/expanding but it is caused by slow routing algorithm.

Automatic layout is very slow for large diagram. Unfortunately we do not have a good incremental orthogonal router
algorithm.

Possible solutions:
1) During animation of graph-layout, temporarily disable routing of connections.
2) Introduce a new/faster orthogonal routing algorithm.
Comment 2 lauri 2007-10-25 10:38:13 UTC
Given you comments, I think it would best to move algorithm out from UI threat (it blocks UI now), or then at least give
some feedback on ongoing work. Right now it just feels that NB died.

t.
Lauri
Comment 3 David Kaspar 2007-10-25 11:02:37 UTC
Actually this cannot be done since results of the algorithm is required for rendering - otherwise the connections would
not be painted.

On the other hand, we can postpone the calculation into a separate thread and replace it with temporary "direct-router".
Unfortunately it is not that easy anyway since the routing of a second connection depends on results of routing the
first connection...
Comment 4 Karol Harezlak 2007-12-12 11:40:01 UTC
Routing algorithm is a part of Graph Libraries not Visual Designer so I'm reassign this bug to the Graph Library module. 
Comment 5 David Kaspar 2008-03-16 16:43:57 UTC
*** Issue 130233 has been marked as a duplicate of this issue. ***
Comment 6 einself 2008-03-16 16:53:09 UTC
Is it possible to deactivate connection drawing?
Comment 7 David Kaspar 2008-03-16 17:28:52 UTC
Not as an user. As a developer you may use DirectRouter instead of used OrthogonalSearchRouter e.g. when you are
animating...
Comment 8 einself 2008-04-16 18:23:08 UTC
I just compiled a version of visual api that does not use orthogonal routers to connect gui elements, but direct 
routers. This is of cource not "eye candy" but it works like a charm for fixing this "performance" bug. Anyone who is 
interested can download it from http://www.ja-nee.net/files/org-netbeans-api-visual.jar. It's build from a snapshot of 
netbeans from yesterday.

Tested with netbeans 6.1 beta.
Comment 9 estevan.diedrich 2010-04-06 15:16:19 UTC
(In reply to comment #8)
> I just compiled a version of visual api that does not use orthogonal routers to
> connect gui elements, but direct 
> routers. This is of cource not "eye candy" but it works like a charm for fixing
> this "performance" bug. Anyone who is 
> interested can download it from
> http://www.ja-nee.net/files/org-netbeans-api-visual.jar. It's build from a
> snapshot of 
> netbeans from yesterday.
> 
> Tested with netbeans 6.1 beta.

This jar dont work on netbenas 6.8, the follows exceptions was throws:

can you help ?

thanks,
Diedrich.

java.lang.NoSuchMethodError: org.netbeans.api.visual.anchor.Anchor.allowsArbitraryConnectionPlacement()Z
	at org.netbeans.modules.visual.router.OrthogonalSearchRouter.routeConnection(OrthogonalSearchRouter.java:143)
	at org.netbeans.api.visual.widget.ConnectionWidget.calculateRouting(ConnectionWidget.java:523)
	at org.netbeans.modules.visual.layout.ConnectionWidgetLayout.layout(ConnectionWidgetLayout.java:112)
	at org.netbeans.api.visual.widget.Widget.layout(Widget.java:1350)
	at org.netbeans.api.visual.widget.Widget.layout(Widget.java:1342)
	at org.netbeans.api.visual.widget.LayerWidget.layout(LayerWidget.java:86)
	at org.netbeans.api.visual.widget.Widget.layout(Widget.java:1342)
	at org.netbeans.api.visual.widget.Scene.layoutScene(Scene.java:315)
	at org.netbeans.api.visual.widget.Scene.validate(Scene.java:396)
	at org.netbeans.modules.vmd.flow.FlowAccessController$1$1.run(FlowAccessController.java:97)
	at org.openide.util.Mutex.readAccess(Mutex.java:362)
	at org.netbeans.modules.vmd.api.model.TransactionManager$1.run(TransactionManager.java:87)
	at org.openide.util.Mutex.readAccess(Mutex.java:362)
	at org.netbeans.modules.vmd.api.model.DescriptorRegistry$2.run(DescriptorRegistry.java:121)
	at org.openide.util.Mutex.readAccess(Mutex.java:362)
	at org.netbeans.modules.vmd.api.model.GlobalDescriptorRegistry.readAccess(GlobalDescriptorRegistry.java:159)
	at org.netbeans.modules.vmd.api.model.DescriptorRegistry.readAccess(DescriptorRegistry.java:119)
	at org.netbeans.modules.vmd.api.model.TransactionManager.readAccess(TransactionManager.java:85)
[catch] at org.netbeans.modules.vmd.flow.FlowAccessController$1.run(FlowAccessController.java:83)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:125)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 10 krisha 2010-11-04 02:53:40 UTC
Here you will find the jar to use FreeRouter on Netbeans 6.9.1:

http://www.cwision.de/projects/NetbeansFreeRouter/
Comment 11 einself 2010-11-04 04:12:52 UTC
this bug is now open for 3 years and nobody introduced a new orthogonal router search algorithm yet (which is not more than eye-candy). so how about replacing this 3 lines (last time i’ve written a patch this were 3 lines, don’t have a clue how much now) to draw a direct router or whatever serves the _purpose_, and close this one? krisha, can you run a diff against HEAD and then provide a patch file, so that people don’t have to constantly replace core files?

cheers

konrad