Bug 156425 - Performance problems in Element.validateNotOwnSelf
Summary: Performance problems in Element.validateNotOwnSelf
Status: VERIFIED FIXED
Alias: None
Product: MDT.UML2
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: Other Linux
: P3 major (vote)
Target Milestone: 2.0.1   Edit
Assignee: Kenn Hussey CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2006-09-06 15:45 EDT by Christian Damus CLA
Modified: 2008-01-28 16:36 EST (History)
0 users

See Also:


Attachments
Patch that fixes the problem for me (1.66 KB, patch)
2006-09-06 15:47 EDT, Christian Damus CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2006-09-06 15:45:16 EDT
The implementation of the Element.validateNotOwnSelf constraint has two performance/scalability issues:

  - calling Element.allOwnedElements() has O(n) complexity.  Checking whether
    any owner (recursively) is self would have O(log(n)) complexity
  - calling Element.allOwnedElements() causes all containment proxies to
    be resolved, loading additional resources unnecessarily

Both of these problems could be resolved by checking the container chain of the element.
Comment 1 Christian Damus CLA 2006-09-06 15:47:04 EDT
Created attachment 49531 [details]
Patch that fixes the problem for me

Attached a patch that fixes the problem for me.  With this change, I no longer get unwanted containment proxy resolution and it seems to perform faster.  I have not tested, though, whether the constraint with this patch still catches ownership cycles.
Comment 2 Kenn Hussey CLA 2006-09-06 16:52:57 EDT
The fix has been committed to CVS.
Comment 3 Kenn Hussey CLA 2006-09-07 15:48:11 EDT
Fixed in M200609071509.
Comment 4 Nick Boldt CLA 2008-01-28 16:36:12 EST
Move to verified as per bug 206558.