Bug 480425 - Unnecessary calls to collectAllLinks in DDiagramCanonicalSynchronizer#createConnections
Summary: Unnecessary calls to collectAllLinks in DDiagramCanonicalSynchronizer#createC...
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 4.0.0M4   Edit
Assignee: Florian Barbin CLA
QA Contact: Laurent Redor CLA
URL:
Whiteboard:
Keywords: performance, triaged
Depends on:
Blocks:
 
Reported: 2015-10-22 10:09 EDT by Florian Barbin CLA
Modified: 2016-06-24 08:02 EDT (History)
1 user (show)

See Also:


Attachments
measurment use case (331.35 KB, application/zip)
2015-10-22 10:12 EDT, Florian Barbin CLA
no flags Details
Measurments before applying the patch (223.41 KB, image/png)
2015-10-22 10:23 EDT, Florian Barbin CLA
no flags Details
Measurments after having applyed the patch (214.52 KB, image/png)
2015-10-22 10:24 EDT, Florian Barbin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Barbin CLA 2015-10-22 10:09:06 EDT
in org.eclipse.sirius.diagram.ui.internal.refresh.diagram.DDiagramCanonicalSynchronizer.createConnections(Collection<SiriusLinkDescriptor>, Map<EObject, View>, Diagram) we call collectAllLinks after each new created GMF edge. collectAllLinks iterates over all the diagram views and edges to maintain the domain2NotationMap. 
That becomes very costly when the number of view is important and when the number of edges increase as we are creating new gmf edges.
Comment 1 Florian Barbin CLA 2015-10-22 10:12:04 EDT
Created attachment 257442 [details]
measurment use case
Comment 2 Florian Barbin CLA 2015-10-22 10:23:17 EDT
Created attachment 257444 [details]
Measurments before applying the patch
Comment 3 Florian Barbin CLA 2015-10-22 10:24:10 EDT
Created attachment 257445 [details]
Measurments after having applyed the patch
Comment 4 Florian Barbin CLA 2015-10-22 10:35:04 EDT
Measurement protocol:
* Import and open the attached project (this project is derived from the 1Milion elements use case by only keeping one reverse package)
* Open the "full-sirius-code package entities" diagram.
* Uncheck the "Unsynchronized" option
* Start the measurement
* Perform a refresh by using the tabbar refresh action
* Stop the measurement at the diagram layout beginning (when the diagram element are displayed)

Without the patch, the synchronizeDiagramGMFModel took around 87s (36% of the time) with the patch it took around 8s (5% of the time)
Comment 5 Florian Barbin CLA 2015-10-22 10:39:54 EDT
To complete the description, collectAllLinks call is unnecessary in createConnections since the connectionsFactory.createEdge(viewDescriptor, domain2NotationMap) adds the new created edge in the domain2NotationMap. There is no reason to iterate again over all GMF views and edges
Comment 6 Eclipse Genie CLA 2015-10-22 10:45:44 EDT
New Gerrit change created: https://git.eclipse.org/r/58729
Comment 8 Florian Barbin CLA 2015-12-08 10:47:36 EST
Fixed on master
Comment 9 Laurent Redor CLA 2016-05-23 10:25:27 EDT
Verified on Sirius 4.0.0 RC1 (4.0.0.201605180923)

Warning: The representation is not visible if you've not org.eclipse.sirius.sample.ecore.design. And it is also not visible in the representations by list (cause of another bug for several Viewpoints with same name). You must find it under the semantic "full-sirius-code" package.
Comment 10 Pierre-Charles David CLA 2016-06-24 08:02:41 EDT
Available in Sirius 4.0.0.