Home » Modeling » Compare » Performance of EMF compare (measuring the execution time for EmfComapre)
|
Re: Performance of EMF compare [message #1778694 is a reply to message #1778668] |
Wed, 20 December 2017 08:18 |
|
Hi Taghreed,
one way of determining the runtime performance is to enable the debug logging in the EMF Compare preferences. This will print a couple of status messages with a time stamp to the log file that you configure. You can then analyze the log-file to find out how long certain steps in the comparison process took.
However, most of the performance measurements of EMF Compare that we do or know of are done by calling EMF Compare programmatically and taking the time before and after the starting certain tasks of EMF Compare. This allows not only to compute the sums that you are interested in, but also allows to warm up before you start measuring.
EMF Compare has a performance measurement project which runs periodically to discover performance impact over time. Have a look at the code of org.eclipse.emf.compare.tests.performance to find out more. Btw, the results of this performance measurements are published here: https://hudson.eclipse.org/emfcompare/view/active/job/master-performance-large/ws/performance/org.eclipse.emf.compare.tests.performance/index.html
Note that after the refactoring of the build-jobs a couple of weeks ago a lot of historical performance data was removed (I guess the job workspace was purged). So this analysis doesn't go back very long. Also, as you can see that the results vary a bit, which is mainly due to changing conditions on the build server and the normal variations on runtime in a JVM.
Hope this helps,
Philip
--
Philip Langer
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Re: Performance of EMF compare [message #1778751 is a reply to message #1778694] |
Wed, 20 December 2017 20:00 |
taghreed altamimi Messages: 184 Registered: October 2014 |
Senior Member |
|
|
Hi Philip,
Thanks for your prompt reply.
I enabled the debug logging in the EMF Compare preferences and i got the following results:
detect matches - START
detect matches - END - Took 11 ms
detect differences - START
detect differences - END - Took 46 ms
detect requirements - START
detect requirement - END - Took 7 ms
detect equivalences - START
detect equivalences - END - Took 0 ms
compare() - starting step: CONFLICT
compare() - FINISH - 109 matches, 1 diffs and 0 conflicts found in 144ms
Based on that :Which one can be the total execution time ??
this 11+46+7+144=208???
OR 144 ms is the total execution time ?? as this status message ""compare() - FINISH - 109 matches, 1 diffs and 0 conflicts found in 144ms"" confused me.
Also how can i call EMF Compare programmatically??
Thanks,
Taghreed
[Updated on: Thu, 21 December 2017 20:05] Report message to a moderator
|
|
| | | |
Re: Performance of EMF compare [message #1779906 is a reply to message #1779874] |
Mon, 15 January 2018 16:34 |
taghreed altamimi Messages: 184 Registered: October 2014 |
Senior Member |
|
|
Hi Philip,
I am really sorry for bothering you with my questions but i am still naive in using EMF Compare.
I still have an error says that Package with uri 'http://www.eclipse.org/uml2/5.0.0/UML' not found.
The code that i am using is
package emfcomparetime;
import java.io.File;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.*;
import org.eclipse.emf.compare.match.DefaultComparisonFactory;
import org.eclipse.emf.compare.match.DefaultEqualityHelperFactory;
import org.eclipse.emf.compare.match.DefaultMatchEngine;
import org.eclipse.emf.compare.match.IComparisonFactory;
import org.eclipse.emf.compare.match.IMatchEngine;
import org.eclipse.emf.compare.match.eobject.IEObjectMatcher;
import org.eclipse.emf.compare.match.impl.MatchEngineFactoryImpl;
import org.eclipse.emf.compare.match.impl.MatchEngineFactoryRegistryImpl;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.compare.utils.UseIdentifiers;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.emf.ecore.EPackage.*;
import org.eclipse.emf.ecore.resource.*;
import org.eclipse.uml2.uml.resource.*;
import org.eclipse.uml2.uml.*;
public class EmfcompareExecTime {
public Comparison compare(File model1, File model2) {
// Load the two input models
ResourceSet resourceSet1 = new ResourceSetImpl();
ResourceSet resourceSet2 = new ResourceSetImpl();
String xmi1 = "modelECommerce-Jan5.uml";
String xmi2 = "modelECommerce-Jan5VR1.uml";
load(xmi1, resourceSet1);
load(xmi2, resourceSet2);
// Configure EMF Compare
IEObjectMatcher matcher = DefaultMatchEngine.createDefaultEObjectMatcher(UseIdentifiers.WHEN_AVAILABLE);
IComparisonFactory comparisonFactory = new DefaultComparisonFactory(new DefaultEqualityHelperFactory());
IMatchEngine.Factory matchEngineFactory = new MatchEngineFactoryImpl(matcher, comparisonFactory);
matchEngineFactory.setRanking(20);
IMatchEngine.Factory.Registry matchEngineRegistry = new MatchEngineFactoryRegistryImpl();
matchEngineRegistry.add(matchEngineFactory);
EMFCompare comparator = EMFCompare.builder().setMatchEngineFactoryRegistry(matchEngineRegistry).build();
// Compare the two models
IComparisonScope scope = EMFCompare.createDefaultScope(resourceSet1, resourceSet2);
return comparator.compare(scope);
}
private void load(String absolutePath, ResourceSet resourceSet) {
URI uri = URI.createFileURI(absolutePath);
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("uml", new XMIResourceFactoryImpl());
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("modelECommerce-Jan5.uml", UMLResource.Factory.INSTANCE);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("modelECommerce-Jan5VR1.uml", UMLResource.Factory.INSTANCE);
// Resource will be loaded within the resource set
resourceSet.getResource(uri, true);
}
public static void main(String[] args)
{
EmfcompareExecTime ee = new EmfcompareExecTime();
ee.compare(new File("modelECommerce-Jan5.uml"),new File("modelECommerce-Jan5VR1.uml"));
}
}
Can you please help me.
Thanks,
Taghreed.
|
|
|
Re: Performance of EMF compare [message #1779972 is a reply to message #1779906] |
Tue, 16 January 2018 09:34 |
|
Hi Taghreed,
When using UML resources, it is best to let UML initialize its needed registry entries since it is far from trivial. Please use the following on all resourceSets you're using: org.eclipse.uml2.uml.resources.util.UMLResourcesUtil.init(resourceSet) .
Laurent Goubet
Obeo
|
|
|
Re: Performance of EMF compare [message #1780023 is a reply to message #1779972] |
Tue, 16 January 2018 15:15 |
taghreed altamimi Messages: 184 Registered: October 2014 |
Senior Member |
|
|
Hi Laurent Goubet,
Thanks for your reply.I tried to fix the code but still have a problem says that Package with uri 'http://www.eclipse.org/papyrus/GQAM/1' not found i believe that package is related to the MARTE profile that i used to annotate my UML models.
Can you please help me. The following is my code:public class EmfcompareExecTime {
public Comparison compare(File model1, File model2) {
// Load the two input models
ResourceSet resourceSet1 = new ResourceSetImpl();
ResourceSet resourceSet2 = new ResourceSetImpl();
String xmi1 = "modelECommerce-Jan5.uml";
String xmi2 = "modelECommerce-Jan5VR1.uml";
load(xmi1, org.eclipse.uml2.uml.resources.util.UMLResourcesUtil.init(resourceSet1));
load(xmi2, org.eclipse.uml2.uml.resources.util.UMLResourcesUtil.init(resourceSet2));
//org.eclipse.uml2.uml.resources.util.UMLResourcesUtil.init(resourceSet1);
//org.eclipse.uml2.uml.resources.util.UMLResourcesUtil.init(resourceSet2);
// Configure EMF Compare
IEObjectMatcher matcher = DefaultMatchEngine.createDefaultEObjectMatcher(UseIdentifiers.WHEN_AVAILABLE);
IComparisonFactory comparisonFactory = new DefaultComparisonFactory(new DefaultEqualityHelperFactory());
IMatchEngine.Factory matchEngineFactory = new MatchEngineFactoryImpl(matcher, comparisonFactory);
matchEngineFactory.setRanking(20);
IMatchEngine.Factory.Registry matchEngineRegistry = new MatchEngineFactoryRegistryImpl();
matchEngineRegistry.add(matchEngineFactory);
EMFCompare comparator = EMFCompare.builder().setMatchEngineFactoryRegistry(matchEngineRegistry).build();
// Compare the two models
IComparisonScope scope = EMFCompare.createDefaultScope(resourceSet1, resourceSet2);
return comparator.compare(scope);
}
private void load(String absolutePath, ResourceSet resourceSet) {
URI uri = URI.createFileURI(absolutePath);
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("uml", new XMIResourceFactoryImpl());
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("modelECommerce-Jan5.uml", UMLResource.Factory.INSTANCE);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("modelECommerce-Jan5VR1.uml", UMLResource.Factory.INSTANCE);
// Resource will be loaded within the resource set
resourceSet.getResource(uri, true);
}
public static void main(String[] args)
{
EmfcompareExecTime ee = new EmfcompareExecTime();
ee.compare(new File("modelECommerce-Jan5.uml"),new File("modelECommerce-Jan5VR1.uml"));
}
}
Thanks,
Taghreed
[Updated on: Tue, 16 January 2018 16:02] Report message to a moderator
|
|
|
Re: Performance of EMF compare [message #1780153 is a reply to message #1780023] |
Thu, 18 January 2018 09:05 |
|
Hi Taghreed,
it looks like you need to register this package in the package registry of your resource set. I'm not familiar with the MARTE profile implementation, however, if a package is missing you normally would have to register it like this:
resourceSet.getPackageRegistry().put("http://www.eclipse.org/papyrus/GQAM/1", <package-instance [maybe something like MARTEPackage.eINSTANCE]>);
It might be better to ask a question like this (loading Papyrus models with profiles programmatically) in the Papyrus forums. Please, for instance, have a look at this post:
https://www.eclipse.org/forums/index.php/t/487392/
Best wishes,
Philip
--
Philip Langer
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Re: Performance of EMF compare [message #1780316 is a reply to message #1780153] |
Fri, 19 January 2018 21:58 |
taghreed altamimi Messages: 184 Registered: October 2014 |
Senior Member |
|
|
Hi Philip,
I fixed the error and registered Marte profile packages but i got another error says that:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at org.eclipse.emf.compare.match.DefaultMatchEngine.<clinit>(DefaultMatchEngine.java:64)
at emfcomparetime.EmfcompareExecTime.compare(EmfcompareExecTime.java:42)
at emfcomparetime.EmfcompareExecTime.main(EmfcompareExecTime.java:68)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 3 more
The way that i did to create the java file that I created plug-in project and added all imported packages to the dependencies then i run it as java application.Can you please help me.
Thanks,
Taghreed
[Updated on: Fri, 19 January 2018 22:02] Report message to a moderator
|
|
| |
Re: Performance of EMF compare [message #1781131 is a reply to message #1781014] |
Thu, 01 February 2018 17:48 |
|
Hi Taghreed,
it seems the JVM is unable to find any jar providing this class at runtime. So you should look at your run config and see if it includes the required features or plug-ins; or if you include all features or plug-ins of the target definition, whether the target is missing a feature or plug-in that includes that.
The target of EMF Compare pulls the following from orbit:
location "http://download.eclipse.org/tools/orbit/downloads/drops/R20170307180635/repository/" {
com.google.guava [15.0.0,22.0.0)
com.google.gson [2.2.4,3.0.0)
org.junit [4,5)
org.apache.log4j [1.2.0,1.3.0)
/* Egit/Jgit */
javaewah
org.apache.commons.compress
org.kohsuke.args4j
/* Egit/Jgit */
org.mockito [1.9.0,2.0.0)
org.hamcrest [1.1.0,2.0.0)
}
Hope that helps!
Best wishes,
Philip
--
Philip Langer
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Re: Performance of EMF compare [message #1781630 is a reply to message #1781131] |
Fri, 09 February 2018 18:28 |
taghreed altamimi Messages: 184 Registered: October 2014 |
Senior Member |
|
|
Hi Philip,
Sorry for being annoying but i am still new to java and EMF compare.I do really appreciate your patience.
I added the missing jar files.I got this message when i tried to run the code :
log4j:WARN No appenders could be found for logger (org.eclipse.emf.compare.EMFCompare).
log4j:WARN Please initialize the log4j system properly.
Can you please help me.
attached the minimal example with java code
[Updated on: Fri, 16 February 2018 16:30] Report message to a moderator
|
|
| |
Goto Forum:
Current Time: Fri Jan 03 00:57:18 GMT 2025
Powered by FUDForum. Page generated in 0.05178 seconds
|