Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Render asynchronously
[EMF Forms] Render asynchronously [message #1751116] Wed, 04 January 2017 15:03 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 20
Registered: January 2016
Junior Member
Hi there,

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?

Cheers,
Hauke

[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 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 55
Registered: September 2016
Member
Hi Hauke,

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.

Best regards

Jonas

--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] Render asynchronously [message #1753510 is a reply to message #1751127] Tue, 07 February 2017 10:58 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 55
Registered: September 2016
Member
Follow-up: I blogged about the replacement of the input:
http://eclipsesource.com/blogs/2017/01/23/emf-forms-1-11-0-feature-change-input-domain-object/
and about the cache:
http://eclipsesource.com/blogs/2017/02/06/emf-forms-1-11-0-feature-view-cache-for-tree-master-detail/

--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:[EMF Forms] ViewModels - GenericEditor
Next Topic:[EMF Forms] Instance model changes in e4
Goto Forum:
  


Current Time: Tue Sep 26 20:13:36 GMT 2017

Powered by FUDForum. Page generated in 0.03918 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software