Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF load diagram file performance problem - eResolveProxy
GMF load diagram file performance problem - eResolveProxy [message #221615] Tue, 17 March 2009 10:09 Go to next message
gad is currently offline gadFriend
Messages: 4
Registered: July 2009
Junior Member
Hello,

I'm using EMF and GMF to load and display a model. Loading of "big" files
(2MB domain file / 200KB diagram file) is slow (1 minute until the diagram
is displayed). Using a profiling tool it seems that a lot of time is spent
in the org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy method.

This does not seem to be related to my domain file and emf loading though,
because in my model all resolveProxies attributes are set to false; this
is confirmed by this test: when I replace GMF with a simple editor my
domain file loads very quickly (< 1 second). So I think it may come from
GMF loading the diagram file.

Is there a way to tell GMF not to use proxy resolution? Or another way to
improve loading performance?

Thank you.
Re: GMF load diagram file performance problem - eResolveProxy [message #221632 is a reply to message #221615] Tue, 17 March 2009 10:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
Doesn't GMF's notation model instance need to refer to your domain model
instance, which might be in a different resource, using proxies. Is
your domain model in a separate resource? What type of referencing
mechanism is being used? Fragment paths?


gad wrote:
> Hello,
>
> I'm using EMF and GMF to load and display a model. Loading of "big"
> files (2MB domain file / 200KB diagram file) is slow (1 minute until
> the diagram is displayed). Using a profiling tool it seems that a lot
> of time is spent in the
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy method.
> This does not seem to be related to my domain file and emf loading
> though, because in my model all resolveProxies attributes are set to
> false; this is confirmed by this test: when I replace GMF with a
> simple editor my domain file loads very quickly (< 1 second). So I
> think it may come from GMF loading the diagram file.
>
> Is there a way to tell GMF not to use proxy resolution? Or another way
> to improve loading performance?
>
> Thank you.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF load diagram file performance problem - eResolveProxy [message #221666 is a reply to message #221632] Tue, 17 March 2009 13:30 Go to previous messageGo to next message
gad is currently offline gadFriend
Messages: 4
Registered: July 2009
Junior Member
Thank you for your answer.

For a given diagram I have two files: a domain file (containing my domain
objects), and a diagram file (containing their position). My domain file
structure is described by an ecore file, where I disabled proxy resolving
for all objects by setting resolveProxies to false them.

As for the referencing mechanism, the domain objects in the domain file
have an ID. When the diagram file needs to reference an object, it uses
domain_file_name#object_id.

I don't know how GMF works internally but to me it looks like as if it
used an ecore file to define the diagram file structure, and in that ecore
file resolveProxies would be set to true?
Re: GMF load diagram file performance problem - eResolveProxy [message #221678 is a reply to message #221666] Tue, 17 March 2009 13:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
So clearly the notation model has cross document references to your
domain model and hence it's going to have to make use of proxies. Are
the IDs you have in your domain model intrinsic (modeled as an
EAttribute with isID true) or extrinsic (represented as a two-way map in
the XML/XMIResourceImpl)?

gad wrote:
> Thank you for your answer.
>
> For a given diagram I have two files: a domain file (containing my
> domain objects), and a diagram file (containing their position). My
> domain file structure is described by an ecore file, where I disabled
> proxy resolving for all objects by setting resolveProxies to false them.
>
> As for the referencing mechanism, the domain objects in the domain
> file have an ID. When the diagram file needs to reference an object,
> it uses domain_file_name#object_id.
>
> I don't know how GMF works internally but to me it looks like as if it
> used an ecore file to define the diagram file structure, and in that
> ecore file resolveProxies would be set to true?
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF load diagram file performance problem - eResolveProxy [message #221704 is a reply to message #221678] Tue, 17 March 2009 14:12 Go to previous messageGo to next message
gad is currently offline gadFriend
Messages: 4
Registered: July 2009
Junior Member
My IDs seem intrinsic as you describe it; I have indeed an EAttribute
named "id" with iD="true".

So if I understand well the fact that GMF is using proxy resolving is not
a matter of GMF configuration but rather a consequence of the way my model
is written?

My goal is to improve performance on loading; is there another (maybe less
impacting) way to do this than "rewriting my model so that GMF no longer
uses proxy resolving"?

Thanks again for your help.
Re: GMF load diagram file performance problem - eResolveProxy [message #221737 is a reply to message #221704] Tue, 17 March 2009 18:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060701030005040607040101
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

I think you're not quite understanding the nature of the problem. The
notation model references the domain model. No matter what you do in
the domain model, using proxies or not, the notation model will
definitely use proxies if the domain model instance is in a different
resource.

Likely you want to take advantage of this method in ResourceImpl (the
base of all Resource implementations).

/**
* Sets the map used to cache the EObject identified by the value
of its ID feature.
* This cache is only activated if the map is not <code>null</code>.
* The map will be lazily loaded by the {@link
#getEObjectByID(String) getEObjectByID} method.
* It is up to the client to clear the cache when it becomes invalid,
* e.g., when the ID of a previously mapped EObject is changed.
* @param intrinsicIDToEObjectMap the new map or <code>null</code>.
* @see #getIntrinsicIDToEObjectMap
*/
public void setIntrinsicIDToEObjectMap(Map<String, EObject>
intrinsicIDToEObjectMap)
{
this.intrinsicIDToEObjectMap = intrinsicIDToEObjectMap;
}

Setting it in your resource factory would be a good place.


gad wrote:
> My IDs seem intrinsic as you describe it; I have indeed an EAttribute
> named "id" with iD="true".
>
> So if I understand well the fact that GMF is using proxy resolving is
> not a matter of GMF configuration but rather a consequence of the way
> my model is written?
>
> My goal is to improve performance on loading; is there another (maybe
> less impacting) way to do this than "rewriting my model so that GMF no
> longer uses proxy resolving"?
>
> Thanks again for your help.
>

--------------060701030005040607040101
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I think you're not quite understanding the nature of the problem.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF load diagram file performance problem - eResolveProxy [message #221871 is a reply to message #221737] Thu, 19 March 2009 09:32 Go to previous messageGo to next message
gad is currently offline gadFriend
Messages: 4
Registered: July 2009
Junior Member
Hello Ed,

Once more, thanks for your help. Though in the end it's a simple
instruction it took me some time to find out how to use this
setIntrinsicIDToEObjectMap method but eventually it worked (thanks to your
previous answer and also to an old post you wrote!
http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 9147.html).
Now the loading is more than two times faster than before.

And after that I came across another option
(OPTION_DEFER_IDREF_RESOLUTION, that again you seem to know about, are you
everywhere? :p http://www.eclipsezone.com/eclipse/forums/t79980.html) that
improved loading even more.

Though not perfect performance is way, way better now. I went from 1
minute to 15 seconds on my test file.

Though it would probably not be a good solution in my case, I'm curious
about domain model and notation model in the same file: would loading be
even faster with this setup?
Re: GMF load diagram file performance problem - eResolveProxy [message #221884 is a reply to message #221871] Thu, 19 March 2009 10:46 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
If they are both in the same file, all references will be IDREF (intra
resource) instead of anyURI (cross resource) so all resolution will
happen immediately during loading or at the end of loading (depending on
the defer option). I imagine this would be a bit faster...

gad wrote:
> Hello Ed,
>
> Once more, thanks for your help. Though in the end it's a simple
> instruction it took me some time to find out how to use this
> setIntrinsicIDToEObjectMap method but eventually it worked (thanks to
> your previous answer and also to an old post you wrote!
> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 9147.html).
> Now the loading is more than two times faster than before.
>
> And after that I came across another option
> (OPTION_DEFER_IDREF_RESOLUTION, that again you seem to know about, are
> you everywhere? :p
> http://www.eclipsezone.com/eclipse/forums/t79980.html) that improved
> loading even more.
>
> Though not perfect performance is way, way better now. I went from 1
> minute to 15 seconds on my test file.
>
> Though it would probably not be a good solution in my case, I'm
> curious about domain model and notation model in the same file: would
> loading be even faster with this setup?
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Announce] GMF 2.2.0M6 is available
Next Topic:Setting properties into GMF
Goto Forum:
  


Current Time: Tue Sep 24 02:13:11 GMT 2024

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

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

Back to the top