Bug 147312 - CrossReferenceAdapter updateImportsAndExports performance can be improved by 10%
Summary: CrossReferenceAdapter updateImportsAndExports performance can be improved by 10%
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major
Target Milestone: 1.0.1   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-06-15 11:30 EDT by Maneesh CLA
Modified: 2010-07-19 12:24 EDT (History)
3 users (show)

See Also:


Attachments
Modified CrossReferenceAdapter file (29.33 KB, text/java)
2006-06-15 11:32 EDT, Maneesh CLA
no flags Details
Patch to reapply the original performance changes (11.03 KB, patch)
2006-07-17 13:22 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 Maneesh CLA 2006-06-15 11:30:59 EDT
updateImportsAndExports in CrossReferenceAdapter uses getInverseReferences call to get inverse references and then discard some of these references if the resource of the referenced is equal to the referencing.

With a special kind of getInverseReferences, which only goes for cross resource reference the calls to this method improve by upto 10%.

Please see the attached CrossReferenceAdapter file, and check out methods named
getInverseReferencersCrossResource
getInverseReferencesCrossResource
getInverseReferencesCrossResource

and the calls to these methods.
Comment 1 Maneesh CLA 2006-06-15 11:32:27 EDT
Created attachment 44530 [details]
Modified CrossReferenceAdapter file
Comment 2 Anthony Hunter CLA 2006-06-16 09:26:30 EDT
Marking as a major issue for RC5. The change involves an API change, so this needs to go into 1.0.
Comment 3 Anthony Hunter CLA 2006-07-11 14:38:26 EDT
Committed patch to R1_0_maintenance
Comment 4 Linda Damus CLA 2006-07-12 10:34:00 EDT
Reopening because the attached file may break the cross reference adapter for feature maps.  The commit of this file has been rolled back until these issues are investigated.  Comments from Christian Damus, which were added to bug 146411 by mistake, are as follows:


Hi, Anthony,

The problem is, that some features marked as "derived" cannot be interpreted as
being unchangeable (read-only) features that don't matter to the computation of
imports and exports.  A particular case of this occurs in feature maps, which
are relatively common in EMF metamodels imported from XSD.

In a feature map representing an XSD group, where the group members are
EReferences, these EReferences are marked as "derived" because their values are
actually derived from the feature map EAttribute (a list of EFeatureMapEntry). 
Despite being derived, they are entirely changeable.  If the cross-referencer
ignores these features, then it will not discover the cross-references that
they contain, which may result in resource-level imports and exports being
missed.

However, it may be that the listening for proxy resolution brings these derived
cross-references to the adapter's attention and gets imports and exports
registered, later.  I'm working on a JUnit test with a metamodel defining a
feature map to see ...
Comment 5 Anthony Hunter CLA 2006-07-14 14:25:44 EDT
Hi Christian, can you look at this defect further
Comment 6 Christian Damus CLA 2006-07-17 13:22:48 EDT
Created attachment 46380 [details]
Patch to reapply the original performance changes

Attached a patch that reapplies the original performance changes, with the following additional updates:

  - replace the "!isDerived" check with an "isChangeable" check
  - factor out the criteria for references that are capable of defining
    imports and exports into a subclass-extensible method that is reused
    throughout the CrossReferenceAdapter for consistency
Comment 7 Christian Damus CLA 2006-07-17 13:24:32 EDT
Adding Anthony to CC to review and apply the patch.
Comment 8 Anthony Hunter CLA 2006-07-18 14:32:44 EDT
I have committed the updated patch to R1_0_maintenance
Comment 9 Eclipse Webmaster CLA 2010-07-19 12:24:30 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime EMF was the original product and component for this bug