Slow Ecore->Xtext serialization [message #668412] |
Thu, 05 May 2011 15:15 |
No real name Messages: 3 Registered: May 2011 |
Junior Member |
|
|
Hi all,
we have an issue when serializing an Ecore model (representing widgets in a UI) to a DSL formatted file using Xtext.
When making changes to the Ecore model (increasing the number of widgets in our model of the UI from one to two) which roughly double the size of the generated file, the time taken to serialize the model increases exponentially.
Profiling shows the majority of the time is taken up in Xtext's AbstractParseTreeConstructor.serialize(EObject object, AbstractToken currentToken, TreeConstructionReportImpl rep), where although the number of nodes in the model doubles (from one to two) the number of tokens visited goes up by a factor of ten. Similar exponential increases are seen increasing from two to three nodes, and so on.
Sorry if the above is vague, but if anyone had any thoughts on what the problem might be (perhaps with our grammar?) it'd be must appreciated. Also, please let me know if we can provide/look at any additional information to help debug this one,
Cheers,
Alasdair
|
|
|
Re: Slow Ecore->Xtext serialization [message #668434 is a reply to message #668412] |
Thu, 05 May 2011 15:42 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Alasdair,
the serializer in Xtext 1.* uses a backtracking algorithm to find a
suitable path through the grammar for your objects. This explains the
exponential runtime. Moritz is currently working on a new implementation
and we expect some serious performance improvements since the complexity
could be reduced.
There are ways to optimize your grammar for the Xtext 1.* algorithm,
e.g. avoid certain usage patterns. Long story short: please provide some
more information about your language.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 05.05.11 17:15, schrieb amaclean@temenos.com:
> Hi all,
>
> we have an issue when serializing an Ecore model (representing widgets
> in a UI) to a DSL formatted file using Xtext.
> When making changes to the Ecore model (increasing the number of widgets
> in our model of the UI from one to two) which roughly double the size of
> the generated file, the time taken to serialize the model increases
> exponentially.
> Profiling shows the majority of the time is taken up in Xtext's
> AbstractParseTreeConstructor.serialize(EObject object, AbstractToken
> currentToken, TreeConstructionReportImpl rep), where although the number
> of nodes in the model doubles (from one to two) the number of tokens
> visited goes up by a factor of ten. Similar exponential increases are
> seen increasing from two to three nodes, and so on.
>
> Sorry if the above is vague, but if anyone had any thoughts on what the
> problem might be (perhaps with our grammar?) it'd be must appreciated.
> Also, please let me know if we can provide/look at any additional
> information to help debug this one,
>
> Cheers,
> Alasdair
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03631 seconds