New Gerrit change created: https://git.eclipse.org/r/44265 New Gerrit change created: https://git.eclipse.org/r/44449 New Gerrit change created: https://git.eclipse.org/r/44470 New Gerrit change created: https://git.eclipse.org/r/44509 The method DeletionCommandBuilder.buildDeleteDiagramElement() is called twice to compute the enability of "delete" and "cut" actions. This gerrit https://git.eclipse.org/r/#/c/44449/ delayed the walk inside semantic models at the execution of the delete command. After a D&D, the lazy cross referencer is removed and added again to moved semantic elements. Indeed, the removal or the addition of the cross referencer performs a full iteration through the content of the element. With this gerrit https://git.eclipse.org/r/#/c/44470/, the lazy cross referencer is not removed for already attached elements. These following methods also do walks inside semantic models: - EditStatusUpdater.changeEnabilityForRelatedAndChildren(IDiagramDialectGraphicalViewer, EObject, boolean). This method is called in post commit after some actions (D&D or add an edge to an element) in order to compute enability of concerned edit parts. - DanglingRefRemovalTrigger.getChangedEObjectsAndChildren(Iterable<Notification>, Predicate<EObject>). After a D&D, the method is called in pre commit. New Gerrit change created: https://git.eclipse.org/r/44670 New Gerrit change created: https://git.eclipse.org/r/44705 New Gerrit change created: https://git.eclipse.org/r/44818 WARNING: this patchset contains 3694 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire Gerrit change https://git.eclipse.org/r/44705 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=e6869bbf5fdc489b0d26f01dd07fae709f86ae62 Gerrit change https://git.eclipse.org/r/44509 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=395db93998cd7ab0491fa5982ff58492e84a3ba0 Gerrit change https://git.eclipse.org/r/44265 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=e74bd1221bfe814bf556dc4f3e913fae45e5f689 Gerrit change https://git.eclipse.org/r/44470 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=8c5caf0cf3e82e8820afa597e3f6aade21e8e9ae Gerrit change https://git.eclipse.org/r/44449 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=e41b9ff55c5020a29ab3fcfa7b641728742b2092 Gerrit change https://git.eclipse.org/r/44818 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=d8a263cecdd04c0bc432b39afddcf895074c2339 Gerrit change https://git.eclipse.org/r/44670 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=7be50252db5445844767c62dc1a9899732a2c787 We'll consider this done for 3.0. There may be other less obvious cases but they will be treated later if they cause actual issues. Validated on Sirius 3.0.0 RC1 with the provided sample. In this sample,Component.payload == true only for non displayed components, the payload is empty until the delete is effectly done. If I change the payload attribute of displayed elements and paly with the selection, the only payload I can see on each selection change is the getName() done by the properties view title refresh. Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0. |
Created attachment 250384 [details] The sample project to use Steps to reproduce: 1. Make sure you have the "org.eclipse.sirius.ui.debug" project in your workspace 2. Launch a runtime and import the attached project. 3. Open the "Sirius Debugging View". 4. Open the session in the sample project and the diagram inside of it. 5. In the debug view, clear the payload access log. 6. In the representation, select the top-level "c.0" container. Do nothing else, click nowhere else. 7. In the debug view, click "Show payload access log" Note how simply selecting c.0 has triggered several walks inside the whole semantic model under it, hitting the payload. More precisely, this is to compute the various "delete" commands and their enablement. With large models these walks can become very costly and make the modeler feel sluggish because these computations are performed as soon as the user clicks somewhere to select an element. The interesting part of the stacks: org.eclipse.sirius.diagram.tools.internal.command.builders.DeletionCommandBuilder.buildDeleteDiagramElement(DeletionCommandBuilder.java:183) org.eclipse.sirius.diagram.tools.internal.command.builders.DeletionCommandBuilder.buildCommand(DeletionCommandBuilder.java:134) org.eclipse.sirius.diagram.tools.internal.command.UndoRedoCapableEMFCommandFactory.buildDeleteDiagramElement(UndoRedoCapableEMFCommandFactory.java:442) org.eclipse.sirius.diagram.ui.graphical.edit.policies.NodeDeletionEditPolicy.buildGlobalDeleteCommand(NodeDeletionEditPolicy.java:92) org.eclipse.sirius.diagram.ui.graphical.edit.policies.NodeDeletionEditPolicy.createDeleteSemanticCommand(NodeDeletionEditPolicy.java:85) We should try to: * reduce the number of different walks we do if possible. * defer the actual walk when the delete action is actually invoked by the user, if ever. This would change the contract as we would not be able to disable the "delete" actions beforehand even if, at invocation time, we decide the deletion is not possible after all. The new behavior should probably be configurable to allow users who want precise feedback at the cost of performance can decide to go back to the current behavior.