Community
Participate
Working Groups
Steps to reproduce 1- Install EcoreTools 2.0.x 2- Import the project in attachment. This is not a modeling project yet, just a simple project containing an Ecore file. 3- Right click on the .ecore file "Initialize Ecore Diagram" 4- Click on finish in the Wizard page to create a .aird file. The UI Thread is then blocked for a very long time, stuck during the Viewpoint enablement (about 10/15 minutes) The EcoreInitDiagram action is actually calling Sirius this way : new RecordingCommand(existingSession .getTransactionalEditingDomain()) { @Override protected void doExecute() { ViewpointSelectionCallback selection = new ViewpointSelectionCallback(); for (Viewpoint previouslySelected : existingSession .getSelectedViewpoints(false)) { selection.deselectViewpoint( previouslySelected, existingSession, new NullProgressMonitor()); } selection.selectViewpoint(EcoreToolsViewpoints .fromViewpointRegistry().design(), existingSession, new NullProgressMonitor()); selection.selectViewpoint(EcoreToolsViewpoints .fromViewpointRegistry().review(), existingSession, new NullProgressMonitor()); selection.selectViewpoint(EcoreToolsViewpoints .fromViewpointRegistry().archetype(), existingSession, new NullProgressMonitor()); selection.selectViewpoint(EcoreToolsViewpoints .fromViewpointRegistry().generation(), existingSession, new NullProgressMonitor()); } }); If I comment out the activation of the "archetype" Viewpoint then the creation is fairly fast. Archetype provides a Diagram Extension with a Layer enabled by default. This diagram extension is applicable to all the diagrams which are going to be created (or are already created) by the enablement of the Design viewpoint. It looks like during the Viewpoint enablement we try to update all the representations which could be extended by this viewpoint : DialectManager.INSTANCE.updateRepresentationsExtendedBy(session, editingDomainViewpoint, true); When doing that we ends up executing a ChangeLayerActivationCommand org.eclipse.sirius.diagram.tools.internal.command.ChangeLayerActivationCommand Which indirectlyh eats 95 % of the time as dDiagram.getActivatedLayers().add(layer) triggers a notification which will be caught by org.eclipse.sirius.diagram.business.internal.componentization.mappings.DiagramMappingsManagerRegistryImpl which will recompute its mapping tables for each diagram which got updated (more than 1000 of them)
Created attachment 245226 [details] reverse-sirius-data.zip simple project
Fixing https://bugs.eclipse.org/bugs/show_bug.cgi?id=440032 has the potential to reduce the time spent from 15 mins to a few seconds without changing the current behavior. BTW I'm not saying we should not change the current behavior, updating all the representations like that has the potential to create problems with teamwork.
Created attachment 245542 [details] Archived project with Benchmarking tests Attaching a project with JUnit tests to reproduce this scenario. 1- Import the project 2- run org.eclipse.emf.ecoretools.design.tests.perf.unit.SessionTests as a Junit plugin tests. On my machine this takes 875 secs. About 20 secs using this fork of Sirius : ttps://github.com/cbrun/org.eclipse.sirius/tree/wip/cbr/440032_diagrammappingmanagers (which is not quite ready to be considered for inclusion.)
(In reply to Cedric Brun from comment #2) > Fixing https://bugs.eclipse.org/bugs/show_bug.cgi?id=440032 has the > potential to reduce the time spent from 15 mins to a few seconds without > changing the current behavior. > > BTW I'm not saying we should not change the current behavior, updating all > the representations like that has the potential to create problems with > teamwork. A possible modification of the current behavior would be to modify only the opened representation (see the representations refresh behavior which also handle the auto/manual refresh)