Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356305 - [xtend] Project setting for disabling automatic java code generation
Summary: [xtend] Project setting for disabling automatic java code generation
Status: CLOSED WONTFIX
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 353463
Blocks:
  Show dependency tree
 
Reported: 2011-08-31 07:26 EDT by Daniel Mising name CLA
Modified: 2017-10-31 11:31 EDT (History)
3 users (show)

See Also:


Attachments
Example Project containing big xtend templates (338.81 KB, application/x-zip-compressed)
2011-08-31 07:28 EDT, Daniel Mising name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Mising name CLA 2011-08-31 07:26:44 EDT
Build Identifier: 20110615-0604

This request is a follow up of this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=353321

The problem describes the behavior of the xtend to java code generator which gets automatically triggered every time you save the xtend files. If your templates grow xtext becomes nearly unusable because the build process takes up to minutes. 


In a template file of about 1400 lines  (including a lot of dispatch methods,
rich strings, loops, contidions,..) + a file containing 400 lines the code
generation takes about 
- 40-70seconds for "updating resource descriptions"
- 2-10 seconds for "xtext validation"
- 50-70 seconds for "invoking build participants"

The attached example shows 

It should be possible to disable the automatic code generation of xtext to java (probably a setting within the project context menu?). This will ensure the workspace does not get rebuilded after each save. 

The attached sample project shows the problem in reality. It includes a grammar for simple interface declarations and a xtend template with a lot of methods. Simply open any of the two xtend files, edit it and hit save. You'll see that Eclipse will rebuild the workspace on each save and it takes up to minutes. As bigger your template grows, as longer the build takes and the template editing becomes impossible. 



Reproducible: Always

Steps to Reproduce:
1. Import the project
2. Open any of the xtend files
3. Edit any line as liked
4. Hit save
Comment 1 Daniel Mising name CLA 2011-08-31 07:28:50 EDT
Created attachment 202500 [details]
Example Project containing big xtend templates
Comment 2 Sven Efftinge CLA 2011-08-31 08:22:39 EDT
Thanks for the test data. We are aware of the bad build performance of Xtend and have already improved the performance of it significantly (compared to 2.0.1). 
Note that the actual generation of Java code is not the problem, but the linking.

I checked your project with the latest build and it takes around 2.5 secs to build one of the mentioned files on my machine. A clean build of the whole project takes around 4 secs. My machine might be a bit faster then yours though.

We have further ideas for improvements and want to go that way instead of disabling indexing for Xtend. Because then you'll end up with all kind of surprising behavior. So that's not an option.

You could try the latest builds but it might contain a bug or something. Also the provisional APIs might have changed. 

If you can't or don't want to upgrade you might want to try disabling automatic project build in your IDE.
Sorry for the inconvenience. 

I close this bug, for the reasons mentioned above, but please note that the test data was really helpful and that we of course take the mentioned performance problems extremely seriously (we've faced them ourselves on a daily basis and know how annoying that is). Feel free to comment further.
Comment 3 Evgeny Voynov CLA 2016-07-20 12:19:57 EDT
I have the same issue and working with .xtend files in IDEA is terrible, because every symbol input causes "Code generation..." task in IDEA tray (with temporary losing code highlighting).

Problem is not in speed of generation (fast enough) - I'm talking about frequency of this!

Beg you, add setting to disabling code generation!
Comment 4 Eclipse Webmaster CLA 2017-10-31 11:31:03 EDT
Requested via bug 522520.

-M.