Bug 531720 - Optimization of DesignServices.getDisplayedEClasses and related
Summary: Optimization of DesignServices.getDisplayedEClasses and related
Status: NEW
Alias: None
Product: Ecoretools
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2018-02-27 03:40 EST by Pierre-Charles David CLA
Modified: 2018-02-27 04:12 EST (History)
1 user (show)

See Also:


Attachments
Sample project to reproduce the issue (434.38 KB, application/zip)
2018-02-27 03:40 EST, Pierre-Charles David CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Charles David CLA 2018-02-27 03:40:20 EST
Created attachment 272897 [details]
Sample project to reproduce the issue

DesignServices.getDisplayedEClasses and related methods use DDiagramQuery.getAllDiagramElements() to obtain all the DNodeLists, but that method also returns all the edges, nodes and list elements. This adds up and causes performance issues.

Using the attached project, with a single diagram showing 1500 EClasses, 1500 EAttributes and 2500 EReferences, opening the diagram takes around 16s, with DesignServices.getDisplayedEClasses identified as a hot spot.

I'll push a patch on Gerrit which uses new DDiagramInternalQuery(diagram).getContainers() instead on several methods of DesignServices. It uses an internal method in Sirius, but results in a significant speedup: a little less than 7s (instead of 16) to open the diagram.
Comment 1 Eclipse Genie CLA 2018-02-27 03:41:55 EST
New Gerrit change created: https://git.eclipse.org/r/118236
Comment 3 Cedric Brun CLA 2018-02-27 04:12:35 EST
Good catch, thanks!