Bug 510507 - [PERFO] Seems like Tree content creation can get into a n^n (or similar) complexity in some cases
Summary: [PERFO] Seems like Tree content creation can get into a n^n (or similar) comp...
Status: CLOSED WONTFIX
Alias: None
Product: Sirius
Classification: Modeling
Component: Tree (show other bugs)
Version: 4.1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1.10   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance, triaged
Depends on: 509519 510519 510508 510520
Blocks:
  Show dependency tree
 
Reported: 2017-01-16 08:34 EST by Pierre-Charles David CLA
Modified: 2017-11-20 03:10 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Charles David CLA 2017-01-16 08:34:01 EST
+++ This bug was initially created as a clone of Bug #509519 +++

- Import the attached projects (there is a Viewpoint Specification Projet and a Modeling project with a single empty Ecore)
- Make sure the "Perfo Tree" viewpoint is enabled and create a new Tree representation on the EPackage
- Right click in the tree on "Create Many EClasses"
-> the code which is launched is in perfo.tree.design.Services.createMany(EPackage) and basically create 20K new EClasses each having 10 attributes, this should end up being a tree with 20K*10=>200K tree items.
-> the UI thread is blocked and CPU goes crazy for a fairly long time, I gave up after 5 minutes

No doubt there is n^n algorithm working its magic here. 

First hint: after a bit of digging, commenting out: 

willBeExpandedOnSelection(RefreshPlan) to always return false makes the whole tree to be created in about 10 seconds
Comment 1 Pierre-Charles David CLA 2017-01-16 08:37:18 EST
Clone to backport the performance improvements on the 3.1.x branch.

Note that not all patches that will be merged for #509519 should be backported, but only the only which offer signifcant improvement without introducing risks of regressions. https://git.eclipse.org/r/#/c/87864/ looks relatively safe.
Comment 2 Pierre-Charles David CLA 2017-11-20 03:10:00 EST
Closing as WONTFIX, no new 3.1.x version is planned.