|[EMF Forms] Render asynchronously [message #1751116]
||Wed, 04 January 2017 15:03
| Hauke Fuhrmann
Registered: January 2016
I have some domain model which I render with EMF Forms which has about 90 controls (all with default renderers, primitive types and some references).
The initial rendering takes on an up-to-date desktop-PC about 2s and on a less performant machine about 10s, no matter how much memory they have (8-16GB). Removing our own validators does not help.
A profiler simply tells me that the time is spent in the method org.eclipse.emf.ecp.ui.view.swt.ECPSWTViewRenderer.render(Composite, EObject, VViewModelProperties).
[Edit:] Digging deeper with JProfiler shows that most of the time (>50%) is spent in GridLayout.layout and Composite.setResizeChildren; both triggered by AbstractSWTRenderer.applyVisible. Only about 15% of the time is spent in SimpleControlSWTRenderer.renderControl.
Are such rendering times typical?
Is there any approach possible where to render the composite asynchronously such that the rest of the application stays responsive in the mean-time?
[Updated on: Wed, 04 January 2017 16:26]
Report message to a moderator
|Re: [EMF Forms] Render asynchronously [message #1751127 is a reply to message #1751116]
||Wed, 04 January 2017 16:32
| Jonas Helming
Registered: September 2016
first of all: 10 seconds are definitely not normal, even for a very complex UI. Are you sure nothing else is happening in the background, e.g. lazy loading the model or any custom validations? It would help, if you could reproduce this with a open model and a minimal example (e.g. make it happen model).
However, for complex UIs, creating the SWT elements will take some time.
It is definitely possible to render the UI asynchronously. We typically use a stack layout to show first that the UI is loading and then we display the actual UI, once it has been loaded. The TreeMasterDetailComposite of EMF Forms already does that by default.
If you always show the same element type, you might consider to replace the input instead of re-rendering the UI, that will save a lot of time.
Finally, if you open the same UI with different types, but they are repeating, you might want to use a cache for the UI and then replace the input when a certain type has been opened before. There is a ready to be used Cache for the default Tree Master Detail Factory.
Get professional Eclipse developer support:
Powered by FUDForum
. Page generated in 0.02045 seconds