Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF Compare] Scalability issues on GenericDiffEngine.getMatchedEObject(EObject) & AbstractC
[EMF Compare] Scalability issues on GenericDiffEngine.getMatchedEObject(EObject) & AbstractC [message #695838] Tue, 12 July 2011 16:03 Go to next message
Eclipse UserFriend
Originally posted by:

Hi folks,

we've been studying to implement some client use-cases reusing EMF
Compare to determine differences between 2 models stored in a CDO Server.

Among several other issues yet to study, I've face scalability issues
with GenericDiffEngine.getMatchedEObject(EObject) and
AbstractCheck.getMatchedEObject(EObject).

org.eclipse.emf.compare.diff.engine.GenericDiffEngine.getMatchedEObject(EObject)
org.eclipse.emf.compare.diff.engine.check.AbstractCheck.getMatchedEObject(EObject)
org.eclipse.emf.compare.diff.engine.check.AbstractCheck.isUnmatched(EObject)

Both method implementations (which are, by the way, duplicated) do use
CrossReferencing to determine which EObjects have been matched during
the Match stage. It seems to me that using CrossReferencing to do this
may be convenient when objects are in memory, but definitely not when
objects are stored remotely. And even when objects are in memory, using
CrossRefercing seems like a bit of overhead. While doing some profiling,
I found it was called dozens (if not hundred) of times per second.

Hacking a bit the code I found its way faster (and probably would have a
negigible effect over memory footprint) to have a "match cache".
Something like:

protected Map<EObject, EObject> matches;

and then getMatched would look like this:

protected final EObject getMatchedEObject(EObject from) {
return matches.get(from);
}

Havent used it, but probably that would need some refinement to work in
a Three Way Comparison scenario, I guess.

This seem to work very well to me. I decided to extend and contribute my
own GenericMatchEngine and AttributesCheck/ReferencesCheck
implementation, overriding those getMatchedEObject methods, but as you
already see, those are declared as final.

Using JDT a bit reveals that this getMatchedEObject is used very much in
each class (used in 11 methods at GenericDiffEngine), and it also seems
to me very much important to leave it unextensible / replaceable.

I would like to ask if it would be feasible to have some intermediate
interface, something like "MatchManager" which takes care of this.
The default implementation will use CrossReferencing, but users could
contribute different MatchManager implementations. Don't care about the
implementation specifics as long as this becomes pluggable /
replaceable. Also, locate this concern in a single place, and you'll get
rid of duplicate code :)

Would like to hear you opinion.
Cheers,
Víctor.
Re: [EMF Compare] Scalability issues on GenericDiffEngine.getMatchedEObject(EObject) &amp; Abstr [message #696221 is a reply to message #695838] Wed, 13 July 2011 14:20 Go to previous messageGo to next message
Cedric Brun is currently offline Cedric BrunFriend
Messages: 431
Registered: July 2009
Senior Member
I would expect that for the "In memory" case the cross referencer would have pretty much the same scalability than a as it's implemented as a Map of EObject,EStructuralFeature.Setting. As it's implemented right now it will cross-reference everything and not only references from/to Match2 or Match3 elements (which are in fact the only one we are interested in). I guess the additional cost you see comes from this.

On the other hand I'm not against replacing or at least allowing overriding of this mechanism, please open a bug cross-posting this discussion.


http://cedric.brun.io news and articles on eclipse and eclipse modeling.
Re: [EMF Compare] Scalability issues on GenericDiffEngine.getMatchedEObject(EObject) &amp;amp; A [message #696311 is a reply to message #696221] Wed, 13 July 2011 16:54 Go to previous message
Eclipse UserFriend
Originally posted by:

Cedric,

> I would expect that for the "In memory" case the cross referencer would
> have pretty much the same scalability than a as it's implemented as a
> Map of EObject,EStructuralFeature.Setting.

Agreed!

> As it's implemented right now
> it will cross-reference everything and not only references from/to
> Match2 or Match3 elements (which are in fact the only one we are
> interested in). I guess the additional cost you see comes from this.

Thats it

> On the other hand I'm not against replacing or at least allowing
> overriding of this mechanism, please open a bug cross-posting this
> discussion.

Done! See https://bugs.eclipse.org/bugs/show_bug.cgi?id=352002

Thanks!
Víctor
Previous Topic:EMF with CDO to model a service
Next Topic:How to create different filters to display the model in a generated EMF editor
Goto Forum:
  


Current Time: Thu Apr 25 14:00:27 GMT 2024

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

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

Back to the top