Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 490983

Summary: Performance issue for session loading when resources have many roots
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: CLOSED FIXED QA Contact: Florian Barbin <florian.barbin>
Severity: normal    
Priority: P3 CC: florian.barbin, laurent.delaigue, laurent.redor, maxime.porhel, pierre-charles.david
Version: 3.1.0Keywords: triaged
Target Milestone: 4.0.0M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/69908
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=9c37bdb8f6a2ae6af51467e7b2749c6b77aca4b9
Whiteboard:
Bug Depends on: 490908    
Bug Blocks:    

Description Pierre-Charles David CLA 2016-04-04 04:13:38 EDT
+++ This bug was initially created as a clone of Bug #490908 +++

I use a model with 5 resources that have many inter-resource links.
One of these resources has many roots (4300).
Loading my session takes 3 minutes, whereas it takes 10 to 15 seconds to load the resources with the reflective ecore editor.

My first analysis indicates that the culprit seems to be ResourceQuery.isRepresentationsResource():
Its implementation goes over each root of the resource to check if it's a DAnalysis. This wouldn't be a problem if it were done only once per resource, but the result isn't cached and ResourceQuery.isRepresentationsResource() is called apparently each time there is a cross-resource link (by the cross-referencer installation and LocalResourceCollector.addInterResourceResourceReference(...))

I think Sirius should find a way to cache the information of whether or not a resource is a representation resource instead of recomputing it each time addInterResourceResourceReference is called. Or maybe addInterResourceResourceReference should do nothing if a reference between the same resources is already known?
Comment 1 Pierre-Charles David CLA 2016-04-04 04:13:59 EDT
Clone to report the fix made in v3.1.x on master.
Comment 2 Eclipse Genie CLA 2016-04-05 08:45:24 EDT
New Gerrit change created: https://git.eclipse.org/r/69908
Comment 4 Laurent Redor CLA 2016-04-20 08:23:16 EDT
Resolved with above commit.
Comment 5 Florian Barbin CLA 2016-05-25 03:52:22 EDT
Verified on Sirius 4.0.0.RC1 by reviewing the commit.
Comment 6 Pierre-Charles David CLA 2016-06-24 08:01:56 EDT
Available in Sirius 4.0.0.