[patch] ElementCompositorService: emit custom notification after finalization of compose() / decompose
Currently, the performance of the annotation view (and probably also other views that use a @org.eclipse.emf.common.notify.Adapter@s to listen for model changes, have a very poor performance in the following cases:
- Addition of large sub-models (typically, via copy'n'paste)
- Removal of large sub-models (typically, removal of an element at the top of the hierarchy)
- This is because EMF will issue a
Notification.REMOVEfor any model element that has been added / removed to the model.
- However, for an efficient update of the GUI, it would be sufficient to be notified after the entire operation has finished.
- At least in the case of removal, the problem cannot be worked around by ignoring some events bases on previously received events, because the recursive implementation of org.fortiss.tooling.kernel.internal.ElementCompositorService.decompose() performs the removal button up. Hence, the events for the elements at level n are received before the events for elements at level n -1, etc.
- Issue a custom notification in org.fortiss.tooling.kernel.internal.ElementCompositorService.(de)compose() which can be observed by views (instead of
- The patch uses
org.fortiss.tooling.kernel.utils.EcoreUtils.postRefreshNotification(), but also a dedicated event could be created (e.g., KERNEL_MODEL_COMPOSITION / KERNEL_MODEL_DECOMPOSITION).
Test case: see attached model
- Open annotation view
- Open model and ensure that the annotation view is populated with it
- Delete any of the component
- Observe the the removal takes very long without the patch
@ Flo / Vincent: Can you please have a comment?
#2 Updated by Simon Barner almost 6 years ago
- File element-compositor-service-custom-events.patch element-compositor-service-custom-events.patch added
- Status changed from New to Feedback
- Assignee changed from Simon Barner to Anonymous
- Target version changed from AF3 2.7 RC1 (features frozen) to AF3 2.7 RC2 (GUI improved)
- Updated patch to apply against current head
- The additional signals that are emitted by the
ElementCompositionServicedue to this patch should have not any further side effects since this notification type is not referenced in the code based. Tested
- @ Vincent: Can you please have a look and re-assign to me. If you do not want to have it in the current release, just set the target version to 2.8
#5 Updated by Anonymous about 5 years ago
- Status changed from Feedback to In Progress
- Assignee changed from Anonymous to Simon Barner
- Target version changed from AF3 2.8 RC1 (Feature Freeze) to AF3 2.8 Post-release
I want to have an improvement before merging the given patch.
One concern is in the use of decomposedNestedInvocationLevel in decompose().
Between the lines
there is another line which can throw NullPointerException.
Once it has happened, the program does not work properly anymore.