| Xtend nearly unusable in big files [message #720750] |
Wed, 31 August 2011 03:56  |
Daniel Missing name Messages: 101 Registered: July 2011 |
Senior Member |
|
|
Hi developers.
I'm currently writing some xtend code generation templates and it really frustrates me.
Nearly time I save my xtend code files Eclipse needs to Build my Workspace twice! It seems xtend build the workspace before the validation starts (to check whether all referenced elements are available). Then the validation starts and the code generation of xtend to java is triggered. And afterwards the whole workspace is rebuilt again because of the new classes.
Each time I save my file the whole Eclipse instance gets unusable (sometimes even unresponsive) till this build process is finished. I tried to disable the automatic build but even then xtend triggers the code generation and therefore the workspace rebuild.
It takes me hours to write templates that really frustrates. I have two template files in my project. One is 1400 lines long and the other 400. Of course xtend needs some heavy operations for validation but on bigger files you get really stuck using xtend.
But on each save new progress tasks get enqueued. If I make changes and hit save a "workspace building" and an "xtext validation" task is enqueued. Sometimes the elements are enqueued twice. I make some additional changes till Eclipse is responsive and hit save again. Then I have 4-6 tasks in my progress queue and can get a cup of coffee till those tasks are complete.
The parts: "Updating resource description x of y" and "Invoking build participants" take the most of the time which is up to 2 minutes.
Is this simply my fault or is it really xtend that becomes quite unusable on huge template files?
Cheers
Daniel
|
|
|
|
| Re: Xtend nearly unusable in big files [message #720773 is a reply to message #720755] |
Wed, 31 August 2011 04:31   |
Daniel Missing name Messages: 101 Registered: July 2011 |
Senior Member |
|
|
Awesome thanks. I couldn't find the bug but I probably used wrong search terms. (I was always searching about the workspace building problem).
My current language is too big that I could simply attach it to a bug. I hope this feature is available soon.
[edit]
I made a comment on the bug and requested a reopening since a turn-off setting is really needed.
[Updated on: Wed, 31 August 2011 04:48] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
| Re: Xtend nearly unusable in big files [message #720880 is a reply to message #720856] |
Wed, 31 August 2011 08:31   |
Sven Efftinge Messages: 1668 Registered: July 2009 |
Senior Member |
|
|
Hi Daniel,
I tried to explain in the comment of the newly filed bug, why disabling the code generation is not an option and what we have done (and still do) about the bad performance of the builder instead.
Does that help?
Sven
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
|
| Re: Xtend nearly unusable in big files [message #720899 is a reply to message #720892] |
Wed, 31 August 2011 09:03   |
Sven Efftinge Messages: 1668 Registered: July 2009 |
Senior Member |
|
|
I'm sorry, but releasing something before 2.1 is not possible, since the time involved in testing and ensuring overall quality of a release is a huge effort (although we have thousands of unit tests).
You could use the latest build and in case you face a show stopper we will be happy to fix it ASAP. I've just updated the links to the various update sites on our web site including a new one pointing to the latest stable build.
Sven
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
|
| Re: Xtend nearly unusable in big files [message #720939 is a reply to message #720921] |
Wed, 31 August 2011 10:07   |
Sven Efftinge Messages: 1668 Registered: July 2009 |
Senior Member |
|
|
That should only be the case if the edited Java file is referenced. Anyway that part can be further improved too.
15 seconds still is too slow. Is that the project build or what happens when you save a single file?
BTW: You should consider having more smaller files. That's not only a good idea for performance reasons.
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
| Re: Xtend nearly unusable in big files [message #720981 is a reply to message #720921] |
Wed, 31 August 2011 11:52   |
|
Originally posted by:
Am 31.08.11 15:48, schrieb Daniel:
> I just tested the the build using the latest nightly build and the build
> takes only 15 seconds on the 1800 lines. I will simply use the latest
> build and hope I do not encounter any bugs. The URL to the latest stable
> build you added is currently mispointing
> (http://download.eclipse.org/modeling/tmf/xtext/updates/composite/latest/ ->
> error 404).
This is an Eclipse Update site/p2 repository; you must access it from
Eclipse.
Regards,
Dennis.
> An improvement from 2:10min to 0:15min is quite impressive, good job.
> Looking forward to more improvements :d Are you already using some kind
> of partial builds and validation? i.e. If I edit the method compileTest
> only this method gets revalidated recompiled? Or are there any plans to
> do that? That would simply boost the system up like hell :d
|
|
|
| Re: Xtend nearly unusable in big files [message #721013 is a reply to message #720791] |
Wed, 31 August 2011 12:54   |
Ed Willink Messages: 3183 Registered: July 2009 |
Senior Member |
|
|
Hi
Not reported against EGit yet. I'm waiting for SR1 before starting to
winge. I think that three or four projects have poor characteristics and
when these combine exponentially we get to the coffee break build
phenomenon.
I suspect that my problem may be different to other peoples because I
have split plugins.
I have an AST plugin in which a *.uml defines the auto-generated *.ecore
and *.java.
I have 5 CST + Editor plugins in which
- *.ecore defines the auto-generated *.java
- *.xtext defines more auto-generated *.java
To avoid polluting the CST plugins with build-only dependencies, I have
a Build 'plugin' that houses *.mwe2 and *.mtl (Acceleo templates) and
*.java.
One mwe2 script drives the *.uml to *.java in the AST plugin and via
Acceleo generates more *.java.
Another mwe2 script drives the 5 CST genmodels for *.ecore to *.Java and
via Acceleo generates more *.java.
Another mwe2 script drives the 5 *.xtext to *.java.
Because MWE2 re-uses the classpath as a modelpath and my models are
referenced as platform:/plugin... the necessary MWE2 modelpath creates a
cyclic Java dependency. Eclipse perceives the Build plugin as dependent
on the CST and AST plugins since they are on the classpath/modelpath,
but running an MWE2 script generates Java upstream in the plugins on
which the Build plugin depends.
I think MWE2 needs to use a modelpath that is analoguous to a classpath
but without making Eclipse think that there is a dependency. I would
gladly provide explicit 'import' statements in the Standalone bean setup
so long as there is a syntax that enables platform:/plugin to correctly
resolve to platform:/resource if present else platform:/plugin in the
normal EMF fashion.
Regards
Ed Willink
On 31/08/2011 09:44, Jan Koehnlein wrote:
> Sounds like a bug in eGit. Did you report it?
>
> We are working hard to improve performance. If you switch to the HEAD
> revision of Xtext, you will already experience a serious speed-up.
>
> Am 31.08.11 10:19, schrieb Ed Willink:
>> Hi Daniel
>>
>> Thanks for some extra insight. I thought it was just me with problems.
>>
>> I see exactly the same issues and I don't use Xtend at all (except in so
>> far as Xtext does on my behalf). I use MWE2 and Acceleo and Xtext.
>>
>> I stepped a bit of MWE when I had some URI resolution bug and saw some
>> double work going on, though I think it was plugin scanning, but perhaps
>> that triggers builds.
>>
>> Anyway, perhaps MWE rather than Xtend or Acceleo is at fault.
>>
>> I find the situation gets particularly bad after a GIT switch-to-branch,
>> since rebuilds start long before GIT has finished and so a sequence of
>> partial builds block GIT progress and fight to complete before GIT and a
>> clean build can complete. Disabling auto-build till GIT completes is
>> almost mandatory.
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 31/08/2011 08:56, Daniel wrote:
>>> Hi developers.
>>> I'm currently writing some xtend code generation templates and it
>>> really frustrates me.
>>> Nearly time I save my xtend code files Eclipse needs to Build my
>>> Workspace twice! It seems xtend build the workspace before the
>>> validation starts (to check whether all referenced elements are
>>> available). Then the validation starts and the code generation of
>>> xtend to java is triggered. And afterwards the whole workspace is
>>> rebuilt again because of the new classes.
>>>
>>> Each time I save my file the whole Eclipse instance gets unusable
>>> (sometimes even unresponsive) till this build process is finished. I
>>> tried to disable the automatic build but even then xtend triggers the
>>> code generation and therefore the workspace rebuild.
>>> It takes me hours to write templates that really frustrates. I have
>>> two template files in my project. One is 1400 lines long and the other
>>> 400. Of course xtend needs some heavy operations for validation but on
>>> bigger files you get really stuck using xtend.
>>> But on each save new progress tasks get enqueued. If I make changes
>>> and hit save a "workspace building" and an "xtext validation" task is
>>> enqueued. Sometimes the elements are enqueued twice. I make some
>>> additional changes till Eclipse is responsive and hit save again. Then
>>> I have 4-6 tasks in my progress queue and can get a cup of coffee till
>>> those tasks are complete.
>>> The parts: "Updating resource description x of y" and "Invoking build
>>> participants" take the most of the time which is up to 2 minutes.
>>> Is this simply my fault or is it really xtend that becomes quite
>>> unusable on huge template files?
>>>
>>> Cheers
>>> Daniel
>>
>
>
|
|
|
| Re: Xtend nearly unusable in big files [message #721075 is a reply to message #721013] |
Wed, 31 August 2011 16:21   |
Sven Efftinge Messages: 1668 Registered: July 2009 |
Senior Member |
|
|
Edward Willink wrote on Wed, 31 August 2011 18:54Hi
I think MWE2 needs to use a modelpath that is analoguous to a classpath
but without making Eclipse think that there is a dependency. I would
gladly provide explicit 'import' statements in the Standalone bean setup
so long as there is a syntax that enables platform:/plugin to correctly
resolve to platform:/resource if present else platform:/plugin in the
normal EMF fashion.
Not sure I completely understood, but MWE2 is not resolving a single URI.
If you want to use platform:resource you need to use the StandaloneSetup class (I think you already do)
and provide one or more folders which should be scanned for eclipse projects or jared bundles.
This has nothing to do with the project's classpath where the MWE2 file resides.
Sven
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
|
| Re: Xtend nearly unusable in big files [message #721189 is a reply to message #721169] |
Thu, 01 September 2011 03:03   |
Sven Efftinge Messages: 1668 Registered: July 2009 |
Senior Member |
|
|
Quote:
Maybe I'm confusing two problems:
a) spurious classpath entries/scanning
My StandaloneSetup config is
bean = StandaloneSetup { resourceSet = resourceSet
platformUri = "./META-INF" // A local folder to
minimize workspace searching
scanClassPath = true // But we do need to search
the plugin-space
uriMap = Mapping {
from = "platform:/plugin/org.eclipse.uml2.uml.resources/"
to = "platform:/resource/org.eclipse.uml2.uml.resources/"
}
uriMap = Mapping {
from = "platform:/plugin/org.eclipse.uml2.uml/"
to = "platform:/resource/org.eclipse.uml2.uml/"
}
}
which scans (everything on) the classPath to enable a standalone usage
to find the two UML plugins that I'm interested in as platform:/resource
names that I can then map to the platform:/plugin names that need
resolving. A more direct
modelPlugin = "org.eclipse.uml2.uml",
"org.eclipse.uml2.uml.resources", "org.eclipse.xtext.common.types"
could support the accesses that I really wanted without needing a
spurious Java classPath entry or scanning every possible plugin.
[I find that MWE's brute force attempts to find everything as well
intentioned but actually unhelpful through depriving users of the
required declarative control and they are very very costly; an MWE
script can easily take 10 seconds before its 'time 0' diagnostic.]
Firstly the class path scanning is only done when executing the Standalonesetup not while checking the MWE2 file within Eclipse. Also the scanClasspath property is just a convenient functionality, for those where this fit nicely. You can instead have multiple settings for platformUri = "file/path/to/plugin".
Quote:
b) cyclic Java class paths
In order for the MWE script to access the *.xtext file, the editor
plugin must be on the class path of the build plugin containing the MWE
script. If the MWE script generates Java into the editor plugin then the
MWE script modifies something on the build plugin classpath, potentially
triggering a rebuild 'cycle' that does not actually rerun the MWE script
but does re-re-build all the transformation templates in the same build
plugin as the MWE script.
If instead an Xtext file was located via a StandaloneSetup import
declaration such as
modelPlugin = "org.eclipse.ocl.examples.xtext.oclinecore" // etc
the Java classpath would not serve a double purpose, the editor plugins
could be omitted from the classpath and the rebuild 'loop' is not created.
Yes, we usually reuse the runtime class path for code generation. This is also mostly because it is so convenient.
But of course not always ideal. Couldn't you just have a dedicated project for your code generation process, where you set up the class path only for that purpose?
Sven
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
|
| Re: Xtend nearly unusable in big files [message #721206 is a reply to message #721198] |
Thu, 01 September 2011 03:32   |
Sven Efftinge Messages: 1668 Registered: July 2009 |
Senior Member |
|
|
[quote title=Daniel wrote on Thu, 01 September 2011 09:23]Sven Efftinge wrote on Wed, 31 August 2011 16:07
Sven Efftinge wrote on Wed, 31 August 2011 16:07BTW: You should consider having more smaller files. That's not only a good idea for performance reasons.
I'll give it a try but it will require a lot of refactoring since there are quite a lot methods which depend on each other and often use dispatching.
Injected extension can significantly reduce the need for changing clients I guess.
Sven
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
|
| Re: Xtend nearly unusable in big files [message #721263 is a reply to message #721252] |
Thu, 01 September 2011 05:41   |
Sven Efftinge Messages: 1668 Registered: July 2009 |
Senior Member |
|
|
You could also use a dedicated target platform which is reachable by a stable relative path from the project you are in.
I didn't get the XXX stuff. It sounded like you need to load classes you are generating in the same process which doesn't sound good, but I'm really not sure I got it.
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
|
| Re: Xtend nearly unusable in big files [message #721424 is a reply to message #721263] |
Thu, 01 September 2011 13:57  |
Ed Willink Messages: 3183 Registered: July 2009 |
Senior Member |
|
|
Hi Sven
> You could also use a dedicated target platform which is reachable by a
> stable relative path from the project you are in.
>
That was possible till we moved to GIT. Anything outside GIT has an
uncertain relative path.
> I didn't get the XXX stuff. It sounded like you need to load classes
> you are generating in the same process which doesn't sound good, but
> I'm really not sure I got it.
In the XXX (and XXX.ui) plugin:
I have XXX.xtext editor which imports the CS model is defined by
XXX.ecore, XXX.genmodel.
'Running' XXX.genmodel produces XXXPackage.java etc etc.
'Running' XXX.mtl produces XXXVisitor.java etc.
In the Build plugin:
I have XXXeditors.mwe2
I have XXXmodels.mwe2 and its support Java code
I have XXX.mtl and its support Java code
I invoke XXXmodels.mwe2
- invokes XXX.genmodel and XXX.mtl
I invoke XXXeditors.mwe2
- transforms XXX.xtext into ....
The Build plugin has the XXX plugin on its class path.
The Build plugin generates Java in the XXX plugin, which is on its
classpath; hence the partial loop.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.02740 seconds