Bug 510519 - [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: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Tree (show other bugs)
Version: 4.1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance, triaged
Depends on: 509519 510520
Blocks: 510507 510508
  Show dependency tree
 
Reported: 2017-01-16 10:45 EST by Maxime Porhel CLA
Modified: 2017-01-16 10:45 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Porhel CLA 2017-01-16 10:45:26 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