Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to speed up serialization
How to speed up serialization [message #972711] Mon, 05 November 2012 21:10 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

I've working on a graphical editor on top of an Xtext/Xbase-based DSL.
As recommended, the diagram is in XMI-file that is linked to data
objects are in an XtextResource, the latter serialized as text. During
debugging I've only created small models that are serialized fairly
quickly. Now I've implemented creating diagrams for existing DSL files,
and it seems to take forever, even for relatively small files. I've read
that Xtext uses a backtracking serialization algorithm, so I assume
there something about my grammar that results in a lot of trying and
failing. I have a some questions relating to this:

- How can I find out which grammar rules are causing problems?
- Is there a way to customize the Serializer so it makes better choices
concerning which paths to follow?

Hallvard
Re: How to speed up serialization [message #972727 is a reply to message #972711] Mon, 05 November 2012 21:20 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Hallvard,

which serializer do you use? Is it based on the ParseTreeConstructor or
on the Sequencer approach (when in doubt, you may browse the mwe2 file
that generates your language).

Best regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 05.11.12 22:12, schrieb Hallvard Trætteberg:
> Hi,
>
> I've working on a graphical editor on top of an Xtext/Xbase-based DSL.
> As recommended, the diagram is in XMI-file that is linked to data
> objects are in an XtextResource, the latter serialized as text. During
> debugging I've only created small models that are serialized fairly
> quickly. Now I've implemented creating diagrams for existing DSL files,
> and it seems to take forever, even for relatively small files. I've read
> that Xtext uses a backtracking serialization algorithm, so I assume
> there something about my grammar that results in a lot of trying and
> failing. I have a some questions relating to this:
>
> - How can I find out which grammar rules are causing problems?
> - Is there a way to customize the Serializer so it makes better choices
> concerning which paths to follow?
>
> Hallvard
Re: How to speed up serialization [message #972772 is a reply to message #972727] Mon, 05 November 2012 22:10 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 05.11.12 13.20, Sebastian Zarnekow wrote:
>
> which serializer do you use? Is it based on the ParseTreeConstructor or
> on the Sequencer approach (when in doubt, you may browse the mwe2 file
> that generates your language).

It seems I'm using the ParseTreeConstructor variant.

Hallvard
Re: How to speed up serialization [message #972782 is a reply to message #972727] Mon, 05 November 2012 22:20 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 05.11.12 13.20, Sebastian Zarnekow wrote:
> Hi Hallvard,
>
> which serializer do you use? Is it based on the ParseTreeConstructor or
> on the Sequencer approach (when in doubt, you may browse the mwe2 file
> that generates your language).

I switched to fragment = serializer.SerializerFragment {} and now it
runs faster! Should have thought of that in the first place.

Hallvard
Re: How to speed up serialization [message #972807 is a reply to message #972782] Mon, 05 November 2012 22:43 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Am 05.11.12 23:20, schrieb Hallvard Trætteberg:
> On 05.11.12 13.20, Sebastian Zarnekow wrote:
>> Hi Hallvard,
>>
>> which serializer do you use? Is it based on the ParseTreeConstructor or
>> on the Sequencer approach (when in doubt, you may browse the mwe2 file
>> that generates your language).
>
> I switched to fragment = serializer.SerializerFragment {} and now it
> runs faster! Should have thought of that in the first place.
>
> Hallvard
>

Thanks for the feedback.

Best regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: How to speed up serialization [message #972813 is a reply to message #972807] Mon, 05 November 2012 22:50 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 05.11.12 14.43, Sebastian Zarnekow wrote:
> Am 05.11.12 23:20, schrieb Hallvard Trætteberg:
>> On 05.11.12 13.20, Sebastian Zarnekow wrote:
>>> Hi Hallvard,
>>>
>>> which serializer do you use? Is it based on the ParseTreeConstructor or
>>> on the Sequencer approach (when in doubt, you may browse the mwe2 file
>>> that generates your language).
>>
>> I switched to fragment = serializer.SerializerFragment {} and now it
>> runs faster! Should have thought of that in the first place.
>>
>> Hallvard
>>
>
> Thanks for the feedback.

Hm. Although it is quicker, it still takes around 15 seconds for a file
that's "small". Still a bit too much, so I still could need some hints for

- how to find out which grammar rules are causing problems?
- a way to customize the Serializer so it makes better choices?

Hallvard
Re: How to speed up serialization [message #973399 is a reply to message #972813] Tue, 06 November 2012 09:47 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Hallvard,

did you try a profiler to see where the time is spent?
Customizing is done via the *Sequencers. Have a look at the
XbaseSemanticSequencer to see how things can be implemented.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 05.11.12 23:52, schrieb Hallvard Trætteberg:
> On 05.11.12 14.43, Sebastian Zarnekow wrote:
>> Am 05.11.12 23:20, schrieb Hallvard Trætteberg:
>>> On 05.11.12 13.20, Sebastian Zarnekow wrote:
>>>> Hi Hallvard,
>>>>
>>>> which serializer do you use? Is it based on the ParseTreeConstructor or
>>>> on the Sequencer approach (when in doubt, you may browse the mwe2 file
>>>> that generates your language).
>>>
>>> I switched to fragment = serializer.SerializerFragment {} and now it
>>> runs faster! Should have thought of that in the first place.
>>>
>>> Hallvard
>>>
>>
>> Thanks for the feedback.
>
> Hm. Although it is quicker, it still takes around 15 seconds for a file
> that's "small". Still a bit too much, so I still could need some hints for
>
> - how to find out which grammar rules are causing problems?
> - a way to customize the Serializer so it makes better choices?
>
> Hallvard
>
Previous Topic:Newline removed when model gets updated
Next Topic:imports 'out of the box'
Goto Forum:
  


Current Time: Fri Apr 19 10:15:32 GMT 2024

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

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

Back to the top