Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Clean build in xtext(Clean build in xtext)
icon5.gif  Clean build in xtext [message #1219131] Mon, 02 December 2013 04:49 Go to next message
Arshad Adavani is currently offline Arshad Adavani
Messages: 103
Registered: July 2013
Location: Bangalore
Senior Member
Hi all,
I have 3 xtext grammars with cross references in my project. And at runtime I have quite large number of DSLs. I have some 45-50 DSLs which are referring each other. When I launch my tool or do a clean build, It takes around 10 MINUTES to build completely. Can anyone suggest me how can I avoid this situation and improve the performance??


Thanks in advance Smile


Arshad
Re: Clean build in xtext [message #1219138 is a reply to message #1219131] Mon, 02 December 2013 05:41 Go to previous messageGo to next message
Christian Dietrich is currently online Christian Dietrich
Messages: 6242
Registered: July 2009
Senior Member
Hi this highly depends on you impl so using a profiler may give you
hints. One possibility could be to give the runtime eclipse more
memory (xmx) other could be to improve scoping or the grammar itself
(no backtracking)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
icon5.gif  Re: Clean build in xtext [message #1219199 is a reply to message #1219138] Mon, 02 December 2013 10:30 Go to previous messageGo to next message
Arshad Adavani is currently offline Arshad Adavani
Messages: 103
Registered: July 2013
Location: Bangalore
Senior Member
Hi Christian,
Thanks for your reply.
My generator will be called in two situations:
1. When I do a clean build and
2. When I save my editor.

Is it possible to know it in the generator through code?? I mean is it possible to know whether that generator is called because of save operation or clean build through code?


Thanks in advance Smile


Arshad
Re: Clean build in xtext [message #1219205 is a reply to message #1219199] Mon, 02 December 2013 10:42 Go to previous messageGo to next message
Christian Dietrich is currently online Christian Dietrich
Messages: 6242
Registered: July 2009
Senior Member
Hi,

afaik there is no such flag
icon5.gif  Re: Clean build in xtext [message #1219218 is a reply to message #1219205] Mon, 02 December 2013 11:42 Go to previous messageGo to next message
Arshad Adavani is currently offline Arshad Adavani
Messages: 103
Registered: July 2013
Location: Bangalore
Senior Member
Hi Christian,
I actually went deeper to get the root cause. Now I know why it is taking so long for the clean build. I will explain you.

Now, say that I have a grammar with ".txt" as dsl file extension.
These DSLs refer to each other. So in my code generator I need all DSL data for correct output. In my case I have some 50-60 DSLs.

What I am doing in the generator:

If I save one of the editors from these 50-60 DSLs, in my generator I load all the other referenced files to get right data. So If I save one file, all referenced files will be loaded and say that this output goes to one of the files known as output.c (this is generated from my generator). This will not cause me any performance issue.

BUT,WHEN I DO A CLEAN BUILD, for each dsl this generator will be called and other all DSLs will be loaded each time resulting overwriting the same output.c again and again.

So you can just guess, when I do a clean build for one file generator will bee called and all references will be loaded and it does the repetitive work almost another 50 times causing performance problems.

Can you guide me in this regard.


Thanks for your help Smile


Arshad
Re: Clean build in xtext [message #1219223 is a reply to message #1219218] Mon, 02 December 2013 12:06 Go to previous messageGo to next message
Christian Dietrich is currently online Christian Dietrich
Messages: 6242
Registered: July 2009
Senior Member
Hi I don't know your business logik. Maybe you search for
http://kthoms.wordpress.com/2011/07/12/xtend-generating-from-multiple-i
nput-models/

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
icon5.gif  Re: Clean build in xtext [message #1219224 is a reply to message #1219223] Mon, 02 December 2013 12:26 Go to previous messageGo to next message
Arshad Adavani is currently offline Arshad Adavani
Messages: 103
Registered: July 2013
Location: Bangalore
Senior Member
Hi Christian,
Thanks a lot for your help. I will try with the help available in the link. Smile


Arshad
Re: Clean build in xtext [message #1219292 is a reply to message #1219218] Tue, 03 December 2013 03:11 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 594
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

Perhaps one possibility is creating a new file type, which represents
the global view and only let the generator for this file update
output.c. For this file type there will typically only be one file. This
file should have an explicit reference to some object in each of the
other files, so Xtext knows of the dependency and can trigger a
re-generation.

Hallvad

On 02.12.13 17:42, Arshad Adavani wrote:
> Hi Christian,
> I actually went deeper to get the root cause. Now I know why it is
> taking so long for the clean build. I will explain you.
>
> Now, say that I have a grammar with ".txt" as dsl file extension.
> These DSLs refer to each other. So in my code generator I need all DSL
> data for correct output. In my case I have some 50-60 DSLs.
>
> What I am doing in the generator:
>
> If I save one of the editors from these 50-60 DSLs, in my generator I
> load all the other referenced files to get right data. So If I save one
> file, all referenced files will be loaded and say that this output goes
> to one of the files known as output.c (this is generated from my
> generator). This will not cause me any performance issue.
>
> BUT,WHEN I DO A CLEAN BUILD, for each dsl this generator will be called
> and other all DSLs will be loaded each time resulting overwriting the
> same output.c again and again.
>
> So you can just guess, when I do a clean build for one file generator
> will bee called and all references will be loaded and it does the
> repetitive work almost another 50 times causing performance problems.
>
> Can you guide me in this regard.
>
>
> Thanks for your help :)
icon5.gif  Re: Clean build in xtext [message #1219358 is a reply to message #1219292] Tue, 03 December 2013 09:15 Go to previous message
Arshad Adavani is currently offline Arshad Adavani
Messages: 103
Registered: July 2013
Location: Bangalore
Senior Member
Hi Hallvard,
I don't want my generator to be executed only once.
Consider I have ".txt" file extension for my grammar.
My grammar has root element which has name property.
Now say I have 50 ".txt" DSLs, out of which 40 DSLs have the same name (and these DSLs have references to each other) and other 10 have different name.
So I want my generator to execute only 11 times when I do a clean build.
I have written code to get these 40 files references when I get first file in the generator. But this stuff is repeating 40 times resulting in same output, hence overwriting the file each time.

Thanks for your help ! Smile


Arshad
Previous Topic:How to check from my Java code whether there are any validation errors in DSL editor
Next Topic:[Xtext 2.4.3] What to do if 'keyword' can occur as an ID as well?
Goto Forum:
  


Current Time: Mon Sep 01 14:50:41 EDT 2014

Powered by FUDForum. Page generated in 0.02051 seconds