Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [XPand/MWE] MWE runs quite slow, since upgrade to latest version of Xpand/Xtext
[XPand/MWE] MWE runs quite slow, since upgrade to latest version of Xpand/Xtext [message #690354] Wed, 29 June 2011 08:20 Go to next message
Eclipse UserFriend
Hello, when running my MWE workflow that generates Java from a model, it is quite slow. Slower than it was before, I just upgraded the XPand and XText plugins.

Particularly it hangs for a long while on this bit: 'Registering platform uri '/Users/me/Work/EclipseWorkspaces'
0    INFO  WorkflowEngine     - --------------------------------------------------------------------------------------
27   INFO  WorkflowEngine     - EMF Modeling Workflow Engine 1.1.0, Build v201106070424
28   INFO  WorkflowEngine     - (c) 2005-2009 openarchitectureware.org and contributors
28   INFO  WorkflowEngine     - --------------------------------------------------------------------------------------
29   INFO  WorkflowEngine     - running workflow: /Users/marten/Work/EclipseWorkspaces/gwt2java/src/workflow/MyProject/generator.mwe
29   INFO  WorkflowEngine     - 
1714 INFO  StandaloneSetup    - Registering platform uri '/Users/me/Work/EclipseWorkspaces'
137997 INFO  StandaloneSetup    - Adding dynamic EPackage 'http://gwt/1.0' from 'platform:/resource/ecore2gwt/metamodels/gwt/gwt.ecore'
138299 INFO  CompositeComponent - Reader: Loading model from platform:/resource/gwt2java/src/Technicom/featuresEnabled.ecore
138492 INFO  CompositeComponent - Generator: generating 'template::Main::main FOREACH model' => Technicom-src-gen
140872 INFO  ProtectedRegionResolverImpl - Source scan started ...


Is the new version doing some sort of directory scan or something? How could this waiting time be reduced? Is my classpath to 'big'? Does that matter?

Because if you see the numbers in the log above, it hangs for about 2 minutes!
Hints would be appreciated. Other than this slow thing, it works fine.
Re: [XPand/MWE] MWE runs quite slow, since upgrade to latest version of Xpand/Xtext [message #690369 is a reply to message #690354] Wed, 29 June 2011 08:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

yes there where heavy changes to StandaloneSetup setPlatformUri e.g.
- .project files are parsed
- jar files are registered as bundles etc
=> a lot more is done as before

Maybe you can try to come up with a subclass of standalonesetup
that overwrites some the expensive stuff if you do not need it.

~Christian
Re: [XPand/MWE] MWE runs quite slow, since upgrade to latest version of Xpand/Xtext [message #690386 is a reply to message #690369] Wed, 29 June 2011 09:08 Go to previous messageGo to next message
Eclipse UserFriend
Or maybe change the way I run things? Because I just register one metamodel, load one model, and convert it to Java using XPand templates.

This is my current workflow (to be sure I am not doing something 'uncommon')

I am actually not sure if I need to use the StandAlone setup! Always running it from Eclipse anyways!

What is the recommended way of running such a workflow if standalone is not necessary??
<?xml version="1.0"?>
<workflow>
    <property name="projectName" value="Technicom" />
    
	<property name="model" value="gwt2java/src/${projectName}/featuresEnabled.ecore" />
	<property name="src-gen" value="${projectName}-src-gen" />
		
	<!-- set up EMF for standalone execution -->
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
		<platformUri value=".."/>
	    <registerEcoreFile value="platform:/resource/ecore2gwt/metamodels/gwt/gwt.ecore" /> 
	</bean>
	
	<!-- clean the src-gen directory 
	     **** WARNING: uncommenting next line also cleans custom code in PROTECTED Regions! ****
	-->	 
	<!-- <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner" directory="src-gen"/> --> 
	
	<!-- load model and store it in slot 'model' -->
	<component class="org.eclipse.emf.mwe.utils.Reader">
		<uri value="platform:/resource/${model}" />
		<firstElementOnly value="false" />
		<modelSlot value="model" />
	</component>
	
	
	<!-- check model -->
	 <!-- 
	 <component class="org.eclipse.xtend.check.CheckComponent"> 
	  <metaModel id="mm" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/> 
	  <checkFile value="metamodel::Checks" />
	  <emfAllChildrenSlot value="model"/> 
	 </component> 
	 -->
	 
	 
	 
	<!--  generate main code, starts up Main.xpt, which calls/starts all the other templates -->
	<component class="org.eclipse.xpand2.Generator">
	    <metaModel id="mm" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel" >
	    </metaModel>
	    <prSrcPaths value="${src-gen}"/>
		<prDefaultExcludes value="true"/>
		<!--<prExcludes value="*.xml"/>-->
        <fileEncoding value="UTF-8"/>
        
        <!-- as in model from <modelSlot value="model" />, shown above -->
		<expand	value="template::Main::main FOREACH model" />
		<outlet path="${src-gen}" >
		  <postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
		</outlet>
	</component>
	
	
	<!-- generate XML files, this is postprocessed with a Xml Beautifier. This can be downloaded at:
		 http://sourceforge.net/projects/fornax/files/utilities-formatter-xml/ (get latest version)
	
		 Following this, add this jar, and the dependencies of it (in the /lib/ dir of the fornax dir)
		 to the build path of the gwtCode.generator.project project.
		 
		 Warning: if you generated badly formatted XML code, this will fall over it. Generate valid code! 
	-->
	<component class="org.eclipse.xpand2.Generator">
	    <metaModel id="mm" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel" >
	    </metaModel>
	    <prSrcPaths value="${src-gen}"/>
		<prDefaultExcludes value="true"/>
		<!--<prExcludes value="*.xml"/>-->
        <fileEncoding value="UTF-8"/>
        
        <!-- as in model from <modelSlot value="model" />, shown above -->
		<expand	value="template::war::Main::xmls FOREACH model" />
		<outlet path="${src-gen}" >
		  <postprocessor class="org.fornax.utilities.formatter.xml.XmlFormatter" />
		</outlet>
	</component>
		
</workflow>

[Updated on: Wed, 29 June 2011 09:10] by Moderator

Re: [XPand/MWE] MWE runs quite slow, since upgrade to latest version of Xpand/Xtext [message #690393 is a reply to message #690386] Wed, 29 June 2011 09:16 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

you need the StandaloneSetup when you call the Workflow via right-click or from Standalone Java Application.

~Christian
Re: [XPand/MWE] MWE runs quite slow, since upgrade to latest version of Xpand/Xtext [message #690399 is a reply to message #690393] Wed, 29 June 2011 09:23 Go to previous messageGo to next message
Eclipse UserFriend
And from a created run-configuration? Do I need StandaloneSetup then?

[Updated on: Wed, 29 June 2011 09:23] by Moderator

Re: [XPand/MWE] MWE runs quite slow, since upgrade to latest version of Xpand/Xtext [message #690403 is a reply to message #690399] Wed, 29 June 2011 09:27 Go to previous message
Eclipse UserFriend
I fixed it using standalonesetup, by putting the dir not to '..', because that workspace dir is pretty large. Limited it to the current project, and it 's quick again!

	<property name="model" value="gwt2java/src/${projectName}/featuresEnabled.ecore" />
	<property name="src-gen" value="${projectName}-src-gen" />
	
	<!-- set up EMF for standalone execution -->
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
		<platformUri value="."/> <!-- ******* this was changed from '..' to '.' -->
	    <registerEcoreFile value="src/metamodel/gwt.ecore" /> 
	</bean>

Previous Topic:[ACCELEO 3] Protected Areas lost
Next Topic:Availability of Accleo version 3.1.x via update site
Goto Forum:
  


Current Time: Thu May 15 13:08:19 EDT 2025

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

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

Back to the top