Automatic layout is slow with JavaFX-based editor
Executing “automatic layout” can become slow for larger graphs when a JavaFX-based diagram editor is open. For a graph with 69 nodes and 73 edges, automatic layouts takes about 5 seconds.
The issue seems to be the handling of layout changes.
EObjectBasedRectangularResizableContentControllerBase
implements
getModelChangeProvider
to return a
LayoutModelElementModelChangeProvider
to react on layout changes.
MVCBundleBase
attaches itself as a listener to this provider and when
the layout of the element changes, it calls MVCBundleBase.changed
:
@Override
public void changed(Object element) {
viewer.updateFromModel();
}
In updateFromModel
, the viewer goes through the whole model and
refreshes all visuals. Since this call to changed
is triggered often
during automatic layout, layout becomes very slow.
(from redmine: issue id 3893, created on 2019-12-09, closed on 2020-04-06)
- Uploads:
- specific-changed-implementations.patch
- specific-changed-implementations-version2.patch
- test.af3_23 Project with large component diagram for testing purposes