Project

General

Profile

Support #2183

[patch] ElementCompositorService: emit custom notification after finalization of compose() / decompose

Added by Simon Barner almost 6 years ago. Updated over 1 year ago.

Status:
In Progress
Priority:
High
Category:
-
Target version:
Start date:
12/11/2014
Due date:
% Done:

0%

Estimated time:

Description

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)
Analysis:
  • This is because EMF will issue a Notification of type Notification.ADD / Notification.REMOVE for 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.
Proposed solution (see attached patch):
  • Issue a custom notification in org.fortiss.tooling.kernel.internal.ElementCompositorService.(de)compose() which can be observed by views (instead of Notification.ADD / Notification.REMOVE).
  • 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 root1, root2, root3
  • Observe the the removal takes very long without the patch

@ Flo / Vincent: Can you please have a comment?

History

#1 Updated by Simon Barner almost 6 years ago

  • File deleted (element-compositor-service-custom-events.patch)

#2 Updated by Simon Barner almost 6 years ago

  • Updated patch to apply against current head
  • The additional signals that are emitted by the ElementCompositionService due to this patch should have not any further side effects since this notification type is not referenced in the code based. Tested org.fortiss.tooling.kernel.utils.EcoreUtils.KERNEL_EMF_EVENT_TYPE_COUNT, org.eclipse.emf.common.notify.Notification.EVENT_TYPE_COUNT
  • @ 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

#3 Updated by Anonymous over 5 years ago

  • Target version changed from AF3 2.7 RC2 (GUI improved) to AF3 2.8 RC1 (Feature Freeze)

#4 Updated by Anonymous about 5 years ago

  • Assignee changed from Anonymous to Anonymous

#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
decomposedNestedInvocationLevel++;
and
decomposedNestedInvocationLevel--;
there is another line which can throw NullPointerException.
Once it has happened, the program does not work properly anymore.

#6 Updated by Anonymous about 5 years ago

  • Tracker changed from Feature to Support

#7 Updated by Anonymous about 5 years ago

  • Priority changed from Normal to High

#8 Updated by Anonymous about 5 years ago

  • Target version changed from AF3 2.8 Post-release to AF3 2.9 Post-release

#9 Updated by Simon Barner almost 5 years ago

  • Target version changed from AF3 2.9 Post-release to AF3 2.10 Feature Freeze

#10 Updated by Simon Barner over 4 years ago

  • Target version changed from AF3 2.10 Feature Freeze to AF3 2.10 Post-release

#11 Updated by Anonymous about 4 years ago

  • Assignee changed from Simon Barner to Florian Hölzl

#12 Updated by Johannes Eder almost 4 years ago

  • Target version changed from AF3 2.10 Post-release to DevTools-NG

#13 Updated by Florian Hölzl almost 3 years ago

  • Target version changed from DevTools-NG to AF3 2.13 RC1 (Feature Freeze)

#14 Updated by Florian Hölzl over 2 years ago

  • Target version changed from AF3 2.13 RC1 (Feature Freeze) to AF3 2.14 RC1 (Feature Freeze)

#15 Updated by Johannes Eder over 1 year ago

  • Target version changed from AF3 2.14 RC1 (Feature Freeze) to Backlog

Also available in: Atom PDF