Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Attribute ID = true slows down performance Pt. II
Attribute ID = true slows down performance Pt. II [message #550264] Thu, 29 July 2010 16:29 Go to next message
Eclipse UserFriend
Originally posted by: ML1984.gmx.de

Hi everybody.

In the thread 'Attribute ID = true slows down performance', it was
discussed how performance problems caused by attribute id use can be
tackled.

In our case, the first solution does not work, while we don't want to
use the second one (we need general approach). I think I have an
explanation for this: In method createObjectFromTypeName of
org.eclipse.emf.ecore.xmi.impl.XMLHandler the appropriate EObject is
created in line 2095:

obj = createObjectFromFactory(eFactory, typeName);

This method call causes also the structural features to be set. If
another EObject is referenced in one of these structural features, it is
not found (neither by XMLResourceImpl.getEObjectByID nor
ResourceImpl.getEObjectByID), because the newly created has no Resource
attached to it.

Attaching the Resource happens in line 2104:

setFeatureValue(peekObject, feature, obj);

The enclosing containment feature is set here and hence the enclosing
Resource. From my point of view, there are a lot of unnecessary
computations done. Do you consider this a bug? Do you have any ideas for
work arounds?

Cheers,
Mark
Re: Attribute ID = true slows down performance Pt. II [message #550274 is a reply to message #550264] Thu, 29 July 2010 16:58 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
Mark,

Comments below.

Mark L. wrote:
> Hi everybody.
>
> In the thread 'Attribute ID = true slows down performance', it was
> discussed how performance problems caused by attribute id use can be
> tackled.
>
> In our case, the first solution does not work, while we don't want to
> use the second one (we need general approach). I think I have an
> explanation for this: In method createObjectFromTypeName of
> org.eclipse.emf.ecore.xmi.impl.XMLHandler the appropriate EObject is
> created in line 2095:
>
> obj = createObjectFromFactory(eFactory, typeName);
>
> This method call causes also the structural features to be set. If
> another EObject is referenced in one of these structural features, it
> is not found (neither by XMLResourceImpl.getEObjectByID nor
> ResourceImpl.getEObjectByID), because the newly created has no
> Resource attached to it.
>
> Attaching the Resource happens in line 2104:
>
> setFeatureValue(peekObject, feature, obj);
>
> The enclosing containment feature is set here and hence the enclosing
> Resource. From my point of view, there are a lot of unnecessary
> computations done. Do you consider this a bug? Do you have any ideas
> for work arounds?
Not sure the thread you're referring to or why the approaches there
don't work. Was OPTION_DEFER_IDREF_RESOLUTION suggested? That delays
lookups until the end of loading and at that point it's possible to
create a map for all the objects with IDs so that all resolutions can be
done quickly based on hash lookup.
>
> Cheers,
> Mark


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:ResourceSet and relative path problem
Next Topic:Generate toString() method based on EMF
Goto Forum:
  


Current Time: Wed Sep 25 09:37:28 GMT 2024

Powered by FUDForum. Page generated in 0.02917 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top